Skip to main content

Using a < and > together in a formula

  • February 25, 2019
  • 9 replies
  • 56 views

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

Justin_Barrett
Forum|alt.badge.img+21

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

Forum|alt.badge.img+14

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


Justin_Barrett
Forum|alt.badge.img+21

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

  • Author
  • Known Participant
  • February 25, 2019

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

Thank you! That worked perfectly.


  • New Participant
  • February 17, 2020

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


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


  • New Participant
  • February 17, 2020

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

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


Forum|alt.badge.img+18

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



Justin_Barrett
Forum|alt.badge.img+21

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.


  • New Participant
  • February 18, 2020

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