Help

Re: Using IF statements for range of numbers

Solved
Jump to Solution
2344 1
cancel
Showing results for 
Search instead for 
Did you mean: 
James_Quek
6 - Interface Innovator
6 - Interface Innovator

Would appreciate some help on IF statements:

I have a field for “WEIGHT” and another for “WEIGHT RANGE”. I would like user to enter his/her weight and need a formula to yield the weight range. eg

42 >> 40-45
48>> 46-50
52>> 51-55
56>> 56-60
63>> 61-65
69>> 66-70

Would there be better alternatives using AND or SWITCH or anything else?

Thank you.

1 Solution

Accepted Solutions
James_Quek
6 - Interface Innovator
6 - Interface Innovator

[SOLVED]
Thanks so much for this elegant solution. Works beautifully.

See Solution in Thread

4 Replies 4

try this and see if this will get through the syntax filter.
IF({FIELD NAME} = “42”, “40-45”, IF({FIELD NAME} = “48”, “46-50”, IF({FIELD NAME} = “52”, “51-55”, IF({FIELD NAME} = “56”, “56-60”, IF({FIELD NAME} = “63”, “61-65”, IF({FIELD NAME} = “69”, “66-70”))))))
You dont need your weight range field with this formula

A SWITCH statement won’t work well because you would have to enter every single possible number. Nested IF statements are the way to go in this situation.

IF( {weight} <  40, "under 40",
IF( {weight} <= 45, "40-45",
IF( {weight} <= 50, "46-50",
IF( {weight} <= 55, "50-55",
IF( {weight} <= 60, "56-60",
IF( {weight} <= 65, "61-65",
IF( {weight} <= 70, "66-70",
"71+"
)))))))
James_Quek
6 - Interface Innovator
6 - Interface Innovator

[SOLVED]
Thanks so much for this elegant solution. Works beautifully.

Thanks for this. Will try it out. Much appreciated!