Results 1 to 9 of 9

Thread: IF Formula

  1. #1
    Seeker Bine's Avatar
    Join Date
    Dec 2020
    Posts
    5
    Articles
    0
    Excel Version
    Excel 2016

    IF Formula



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Dear all,

    This is driving me crazy, i just want that my formula says e.g. "Underweight" when the value in O2 is below 18.5, "Normal" if the value is between 18.5 and 24.9:

    Underweight = <18.5
    Normal weight = 18.524.9
    Overweight = 2529.9
    Obesity = BMI of 30 or greater

    Why is this not working :

    =IF(O2<18.5,"Underweight",IF(18.5<=O2<=24.9,"Normal",IF(25<=O2<=29.9,"Overweight",IF(O2>30,"Obesity"))))

    Thank you so much for any suggestions!!

  2. #2
    Administrator AliGW's Avatar
    Join Date
    Nov 2015
    Location
    Ipswich, Suffolk, England
    Posts
    1,528
    Articles
    0
    Excel Version
    Office 365 Subscription
    You’ll need this:

    =IF(AND(18.5<=O2,O2<=24.9), ...

    or something along those lines.
    Ali
    Enthusiastic self-taught user of MS Excel!

  3. #3
    Seeker Bine's Avatar
    Join Date
    Dec 2020
    Posts
    5
    Articles
    0
    Excel Version
    Excel 2016
    Thank you, but unfortunately it doesnt work.. I think i do something wrong ..

  4. #4
    Administrator AliGW's Avatar
    Join Date
    Nov 2015
    Location
    Ipswich, Suffolk, England
    Posts
    1,528
    Articles
    0
    Excel Version
    Office 365 Subscription
    Most probably, but it's the best I can offer without seeing your sample workbook.
    Ali
    Enthusiastic self-taught user of MS Excel!

  5. #5
    Seeker Bine's Avatar
    Join Date
    Dec 2020
    Posts
    5
    Articles
    0
    Excel Version
    Excel 2016
    Quote Originally Posted by AliGW View Post
    Most probably, but it's the best I can offer without seeing your sample workbook.
    Seems I am nearly there now with:
    =IF(O2<18.5,"Underweight",IF(AND(18.5<=O2,O2<=24.9),"Normal",IF(AND(25<=O2,O2<=29.9),"Overweight"))) Working

    Just adding the last argument like below it says there are too many arguments.. dont understand why it works with 3 ifs but not with 4 ifs:

    =IF(O2<18.5, "Underweight",IF(AND(18.5<=O2,O2<=24.9),"Normal"),IF(AND(25<=O2,O2<=29.9),"Overweight"),IF(O2>30,"Obesity"))

  6. #6
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,844
    Articles
    0
    Excel Version
    365
    Try:
    Code:
    =INDEX({"Underweight";"Normal";"Overweight";"Obesity"},MATCH(O2,{0;18.5;25;30}))
    or:
    Code:
    =VLOOKUP(O2,{0,"Underweight";18.5,"Normal";25,"Overweight";30,"Obesity"},2)

  7. #7
    Seeker Bine's Avatar
    Join Date
    Dec 2020
    Posts
    5
    Articles
    0
    Excel Version
    Excel 2016
    Quote Originally Posted by p45cal View Post
    Try:
    Code:
    =INDEX({"Underweight";"Normal";"Overweight";"Obesity"},MATCH(O2,{0;18.5;25;30}))
    or:
    Code:
    =VLOOKUP(O2,{0,"Underweight";18.5,"Normal";25,"Overweight";30,"Obesity"},2)

    Thank you so much, the first one with the INDEX is working perfect !!! Finally!!

  8. #8
    Super Moderator Bob Phillips's Avatar
    Join Date
    Mar 2011
    Posts
    1,841
    Articles
    0
    Excel Version
    O365
    You can also do it with just simple IFs

    =IF(O2<18.5,"Underweight",IF(O2<=24.9,"Normal",IF(O2<=29.9,"Overweight","Obese")))

  9. #9
    Seeker Bine's Avatar
    Join Date
    Dec 2020
    Posts
    5
    Articles
    0
    Excel Version
    Excel 2016
    Quote Originally Posted by Bob Phillips View Post
    You can also do it with just simple IFs

    =IF(O2<18.5,"Underweight",IF(O2<=24.9,"Normal",IF(O2<=29.9,"Overweight","Obese")))
    Great, thank you very much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •