Help

Re: Can we use an AND operator in an IF statement?

1154 0
cancel
Showing results for 
Search instead for 
Did you mean: 

Can we combine 2 things in an “IF” statement using “AND” or “&”?

For example, what if we wanted to compare 2 different sets of date fields. In other words, if I was using plain English, I would want to say something like this:

IF ( IS_AFTER({Event Start Date}, {Location Start Date}) AND IS_BEFORE ({Event End Date}, {Location End Date}), "Yes", "No" )

or I would want to say something like this:

IF( {Event Start Date} > {Location Start Date} AND {Event End Date} < {Location End Date}, "Yes", "No"

I know that both of those formulas are invalid formulas, but I’d love to say something like that in Airtable, using Airtable’s syntax.

Thanks! :slightly_smiling_face:

2 Replies 2

You would do this: IF(AND(IS_AFTER({Event Start Date}, {Location Start Date}),IS_BEFORE({Event End Date}, {Location End Date})),"Yes","No") or do this IF(AND({Event Start Date} > {Location Start Date},{Event End Date} < {Location End Date}),"Yes","No")

Basically, use AND() as the first argument in the IF() statement. For your reference, OR() works the same way.

@Kamille_Parks, this is fantastic! Thank yo so much for outlining this for me! I greatly appreciate it! :slightly_smiling_face: