Feb 25, 2019 07:51 AM
I need to create a formula that does this:
Attendee Count < 100 put in 1
Attendee Count > 201 < 1000 put in 2
Attendee Count > 1001 < 5000 put in 3
Attendee Count > 5001 put in 4
Feb 25, 2019 08:56 AM
For this you’ll need to nest a series of IF operations, also using AND to combine some pieces. (I’m also guessing that “201” should be “101” in your example above.)
IF({Attendee Count} < 100, 1,
IF(AND({Attendee Count} > 100, {Attendee Count} <= 1000), 2,
IF(AND({Attendee Count} > 1000, {Attendee Count} <= 5000), 3, 4)))
Feb 25, 2019 09:01 AM
You don’t actually need the ANDs in there if the IF statements are ordered correctly. This should be fine:
IF({Attendee Count} < 100, 1,
IF({Attendee Count} <= 1000, 2,
IF({Attendee Count} <= 5000, 3, 4)))
Feb 25, 2019 09:10 AM
Good point! It could also be done in reverse order:
IF({Attendee Count} > 5000, 4,
IF({Attendee Count} >= 1000, 3,
IF({Attendee Count} >= 100, 2, 1)))
Feb 25, 2019 09:19 AM
Thank you! That worked perfectly.
Feb 17, 2020 12:44 PM
Could you help me with this… pretty similar to the above but I am using TRUE
I want to know what is the proper formula to use this…
IF(Checkincount= 99, TRUE(), FALSE())
I’d like to have an or option meaning
IF(Checkincount= 99, TRUE(), FALSE()), OR IF(Checkincount= 199, TRUE(), FALSE()), OR IF(Checkincount= 299, TRUE(), FALSE())
I can’t seem to find the right formula to use the OR
Meaning, I want it to show if Checkincount is 99 or 199 or 299 etc…
Hope that makes sense.
Thanks
Feb 17, 2020 12:45 PM
Justin_Barrett, Could you help me with this… pretty similar to the above but I am using TRUE
I want to know what is the proper formula to use this…
IF(Checkincount= 99, TRUE(), FALSE())
I’d like to have an or option meaning
IF(Checkincount= 99, TRUE(), FALSE()), OR IF(Checkincount= 199, TRUE(), FALSE()), OR IF(Checkincount= 299, TRUE(), FALSE())
I can’t seem to find the right formula to use the OR
Meaning, I want it to show if Checkincount is 99 or 199 or 299 etc…
Hope that makes sense.
Thanks
Feb 17, 2020 05:29 PM
Feb 17, 2020 05:55 PM
I’m glad that @Jeremy_Oglesby jumped in and shared a solution in your other thread. However, to answer your question, if you want to use OR()
with a collection of conditions, you need to put all of those conditions inside the OR()
function, like this:
IF(
OR(
Checkincount=99,
Checkincount=199,
Checkincount=299
),
TRUE(),
FALSE()
)
Unlike OR
in a true programming language, OR()
in an Airtable formula is a function, not an operator, which is why you pass in the comparisons as arguments to the function.
Also, because the OR()
function returns TRUE
or FALSE
on its own, it’s technically redundant to wrap the IF()
function around it just to return the same result, so you could use OR()
by itself if you wish:
OR(
Checkincount=99,
Checkincount=199,
Checkincount=299
)
Just FYI, Airtable may display 1 or 0 instead of TRUE
or FALSE
, but 1 equates to TRUE
, and 0 equates to FALSE
, so it will still work with other fields reading the result of this formula.
Feb 18, 2020 01:35 AM
Thank you so much. I appreciate you taking the time to explain that to me. It worked. You rock
Thanks again