Nested If Statement

trevor4370

New Member
Joined
Aug 5, 2018
Messages
2
I need a result from the following

18.5 or less = Underweight
18.5 to 24.99 = Normal Weight
25 to 29.99 = Overweight
30 to 34.99 = Obesity (Class 1)
35 to 39.99 = Obesity (Class 2)
40 or greater = Morbid Obesity

I tried this but something is wrong (O10 is the reference field)

=IF((O10>=18.4,O10<18.5),"Underweight",
IF(AND(O10>=18.6,O10<24.99),"Normal Weight",
IF(AND(O10>=25,O10<29.99,"Overweight",
IF(AND(O10>=30,O10<34.99,"Obesity (Class 1)",
IF(AND(O10>=35,O10<39.99,"Obesity (Class 2)",
IF(AND(O10>=40,"Obese", No Result")))))
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hi,

Use LOOKUP rather than a nested IF.

"18.5 or less = Underweight
18.5 to 24.99 = Normal Weight"

I've assumed less than 18.5 = Underweight, 18.5 to 24.99 = Normal Weight

If the Tier levels may change frequently, I recommend setting up a Table for the LOOKUP formula to reference to, this is "hard-coded":


Book1
OPQ
1018.5Normal WeightNormal Weight
Sheet171
Cell Formulas
RangeFormula
P10=LOOKUP(O10,{0,1,18.5,25,30,35,40},{"No Result","Underweight","Normal Weight","Overweight","Obesity (Class 1)","Obesity (Class 2)","Morbid Obesity"})
Q10=IF(O10>=1,IF(O10<18.5,"Underweight",IF(O10<25,"Normal Weight",IF(O10<30,"Overweight",IF(O10<35,"Obesity (Class 1)",IF(O10<40,"Obescity (Class 2)","Morbid Obesity"))))),"No Result")


EDIT: I've included "No Result" in case of O10 being Blank or zero. Also included what a Nested IF would look like.
 
Last edited:
Upvote 0
I would think something like the following will work - It is an escalating scale where it is not possible for any O10 Value to match more than 1 of the conditions :

Dim class as string

IF O10 => 18.4 then class = "Underweight"
IF O10 => 18.6 then class = "Normal Weight"
IF O10 => 25.0 then class = "Obesity Class 1"
IF O10 => 30.0 then class = "Obesity Class 2"
IF O10 => 40.0 then class = "Obese"
 
Upvote 0
Hi,

Use LOOKUP rather than a nested IF.

"18.5 or less = Underweight
18.5 to 24.99 = Normal Weight"

I've assumed less than 18.5 = Underweight, 18.5 to 24.99 = Normal Weight

If the Tier levels may change frequently, I recommend setting up a Table for the LOOKUP formula to reference to, this is "hard-coded":

OPQ
1018.5Normal WeightNormal Weight

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet171

Worksheet Formulas
CellFormula
P10=LOOKUP(O10,{0,1,18.5,25,30,35,40},{"No Result","Underweight","Normal Weight","Overweight","Obesity (Class 1)","Obesity (Class 2)","Morbid Obesity"})
Q10=IF(O10>=1,IF(O10<18.5,"Underweight",IF(O10<25,"Normal Weight",IF(O10<30,"Overweight",IF(O10<35,"Obesity (Class 1)",IF(O10<40,"Obescity (Class 2)","Morbid Obesity"))))),"No Result")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



EDIT: I've included "No Result" in case of O10 being Blank or zero. Also included what a Nested IF would look like.

Thank you for you help - all good now.
 
Upvote 0
You're welcome, welcome to the forum.
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top