Help

Re: Using a < and > together in a formula

2769 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Stacy_Carlson
6 - Interface Innovator
6 - Interface Innovator

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

9 Replies 9

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)))

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)))

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)))

Thank you! That worked perfectly.

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

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

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.

Thank you so much. I appreciate you taking the time to explain that to me. It worked. You rock
Thanks again