Skip to main content
Solved

IF formula to return # of hours only if month falls within a date range

  • November 30, 2023
  • 2 replies
  • 20 views

Forum|alt.badge.img+3

Hi-  I'm a pretty new Airtable user, and have been trying to find solutions via the community posts, but haven't seen anything exactly addressing what I'm attempting to do.

I am trying to populate a field with a number of hours to be worked, only if the month for that work falls within a date range.  In Excel, I was able to make this formula work:  =IF(Column's Month<=Completion Date,Average Monthly Software Hours,0)-IF(Start Date>=Column's Month,Average Monthly Software Hours,0)

I tried to replicate the formula in Airtable that I successfully did in Excel, but it isn't returning the same values.

I've attached a screenshot of the base as well as the formula I tried.  It feels like there's something wrong with how I'm handling the Column's Month formatting, but I can't figure out what...

Many thanks in advance!

-Robin

Best answer by Sho

Hi @RobinJ,
Welcome to Airtable Community.

Excel and Airtable formulas are different.
It is recommended to read the reference once.
Formula Field Reference - Overview | Airtable Support

Date values must be enclosed in quotation marks, like strings.
Also a dedicated function is provided for date/time comparisons.

2 replies

Forum|alt.badge.img+21
  • Inspiring
  • Answer
  • November 30, 2023

Hi @RobinJ,
Welcome to Airtable Community.

Excel and Airtable formulas are different.
It is recommended to read the reference once.
Formula Field Reference - Overview | Airtable Support

Date values must be enclosed in quotation marks, like strings.
Also a dedicated function is provided for date/time comparisons.


Forum|alt.badge.img+3
  • Author
  • New Participant
  • November 30, 2023

The quotes!!! That's all I needed to make it work.  Thank you so much!