If statement help needed




I am trying to write a formula for above table. 

there are 3 conditions. IF ( 20 < "age cell" < 39 AND "gender cell" = "female" AND BAI < %21  THEN RESULTS = UNDERWEIGHT)

And so on. 

If i get help with first line I can write the rest. thank you

6 Replies

Hi @msm66,

This is one approach. 

=IF(AND(A2>20,A2<39,B2="Female",C2<21)=TRUE,"Underweight","something else")


Have fun with that.




Best Response confirmed by msm66 (Contributor)

@msm66 Please see attached workbook. I combined the check for both men and women and all age ranges and BAI range in one formula so it looks a bit long but captures every scenario you described.


Thank you very much Ben that was extremely helpful.
Thank you very much for taking your time and writing the whole code. I was amazed. That was genius.
There Is only one problem. How you were able to save it as .xlsx? it is giving me a hard time that because of macro I need to save it s .xlms
I was wondering how you were able to save it in xlsx format? thanks again

@msm66 My Excel default is .xlsx. You can simply Save As it and choose .xlsm (or .xlsb) - both work for macro. Or just right click on the Tab "Sheet1" then choose Move or Copy... and Move the selected sheet to your xlsm workbook