Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here

# If And Formula Is Not Working

Topic Labels: Formulas
585 4
cancel
Showing results for
Did you mean:
5 - Automation Enthusiast

For whatever reason I cannot get this formula to work. I am looking to sum the hours in a total hours column if the project name is equal to “Sick Day” and the date column is greater than 12/31/18. I am using this formula but its returning all sick day hours regardless of the date.

IF(AND({Date}>“12/31/18”,{Project Name}=“Sick Day”),{Total Hrs},0)

Any help would be much appreciated. Thanks

4 Replies 4
14 - Jupiter

I assume the field called `{Date}` is actually a Date field, in which case your formula is trying to compare date data with a string using a mathematical operator. That’s not going to work because Airtable’s formulas don’t coerce data types for you to allow you to make comparisons in that way.

I’d suggest looking into these Date functions on the support pages

5 - Automation Enthusiast

Yes, that is correct. I guess there is no solution to how i currently have this constructed. I would need a column where every cell is 12/31/18 i guess?

5 - Automation Enthusiast

@Jeremy_Oglesby thank you. The following worked:

IF(AND(IS_AFTER(Date,‘12/31/18’),{Project Name}=“Sick Day”),{Total Hrs},0)

5 - Automation Enthusiast

I have another issue that I am not sure is possible to do in airtable. But basically, I have one table with labor hours. It lists the hours worked each day on various projects by each employee.

On another table i have a list of all the projects. I was hoping on the same table to summarize how many hours each employee had at each project listed. In excel this is an easy task but am having a really hard time figuring out how to do it here. Any thoughts on how I could possible solve this?