Help

IF formula not working to pull data from two columns

Topic Labels: Formulas
1909 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Valerie_Martin
4 - Data Explorer
4 - Data Explorer

This formula is not working to pull data from the two formula columns (Days Actually Out and Backdata days out) I want. It seems so simple. If the DATE OUT is before or is today, pull this number. If the date is AFTER today, pull another.

IF({Date Out} <= TODAY(), {Days Actually Out}, IF({Date Out} > TODAY(), {Backdata days out}))

It currently only pulls the ‘Backdata days out’ data for this column. . . Can anyone tell me if this is a no-no in AirTable or if I’m doing something wrong?

2 Replies 2
PC1
5 - Automation Enthusiast
5 - Automation Enthusiast

Not sure if this is your issue but here is a link to a similar problem I had. It was suggested (and worked) to add AND.

AlliAlosa
10 - Mercury
10 - Mercury

Is {Date Out} a date field? If not, that could be the source of your problems.

I actually didn’t realize that Airtable supports logical operators in comparing dates, but it appears they do. I tested your formula and it worked for me (but if {Date Out} is not a date field, it will produce wonky results).

I would say it’s probably better practice, though, to change your logical operators to date time functions like IS_BEFORE(), IS_SAME(), and IS_AFTER().

Try the following:

IF({Date Out}, IF(OR(IS_SAME({Date Out}, TODAY()), IS_BEFORE({Date Out}, TODAY())), {Days Actually Out}, {Backdata days out}))