Forum Discussion

msm66's avatar
msm66
Brass Contributor
Jun 30, 2020
Solved

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

  • 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.

6 Replies

  • hynguyen's avatar
    hynguyen
    Iron 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.

    • msm66's avatar
      msm66
      Brass Contributor
      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
      • hynguyen's avatar
        hynguyen
        Iron Contributor

        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

    • msm66's avatar
      msm66
      Brass Contributor
      hynguyen,
      Thank you very much for taking your time and writing the whole code. I was amazed. That was genius.
  • Bennadeau's avatar
    Bennadeau
    Iron Contributor

    Hi msm66,

    This is one approach. 

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

    Have fun with that.

     

    Ben

     

    • msm66's avatar
      msm66
      Brass Contributor
      Thank you very much Ben that was extremely helpful.