Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

If (or?) Formula help please

Topic Labels: Formulas
476 6
cancel
Showing results for 
Search instead for 
Did you mean: 

I am not sure how to add in an “or” situation to this formula.
Here is my formula:
IF({Task Start Date},IF({Task Status}=‘Completed’,{Description}&" | “&‘COMPLETE’&” | “&DATETIME_FORMAT({Status Updated},‘MM/DD’),{Description}&” | “&DATETIME_FORMAT({Task Start Date},‘MM/DD’)),{Description}&” |")

This only works if my Task Start Date is completed, but I need the Description to show regardless of the date column being filled.
Does this need an if/or statement?

Thanks!

6 Replies 6

If {Description} is supposed to always be present, you could take out of the IF() statement. Try a simplified formula like this one:

{Description} & IF({Task Status}="Completed", " | " & "COMPLETE" & " | " & DATETIME_FORMAT({Status Updated},"MM/DD"), IF({Task Start Date}, " | " & DATETIME_FORMAT({Task Start Date},"MM/DD")))

The middle of the formula could be simplified a hair further. There’s no need to concatenate several literal strings…

... " | " & "COMPLETE" & " | " ...

Merge them into a single string:

... " | COMPLETE | " ...

lol, I should have seen that!

Thank you for your help. Unfortunately, the simplified formula is not working either and just gives an #ERROR!.
Don’t I need an “or” statement?

If I understand your desired end result correctly, no you don’t need an OR() statement. You may be getting an error if your date fields aren’t filled in. So try something like this:

{Description} & IF(AND({Status Updated}, {Task Status}="Completed"), " | COMPLETE | " & DATETIME_FORMAT({Status Updated},"MM/DD"), IF({Task Start Date}, " | " & DATETIME_FORMAT({Task Start Date},"MM/DD")))

I’m thinking it might not be working because the “Task Start Date” is filled when a script template is used. Could that be why the error is happening?