SOLVED

If statement help needed

%3CLINGO-SUB%20id%3D%22lingo-sub-1500563%22%20slang%3D%22en-US%22%3EIf%20statement%20help%20needed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1500563%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture.JPG%22%20style%3D%22width%3A%20559px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202454i41DB21B2227A070B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Capture.JPG%22%20alt%3D%22Capture.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20write%20a%20formula%20for%20above%20table.%26nbsp%3B%3C%2FP%3E%3CP%3Ethere%20are%203%20conditions.%20IF%20(%2020%20%26lt%3B%20%22age%20cell%22%20%26lt%3B%2039%20AND%20%22gender%20cell%22%20%3D%20%22female%22%20AND%20BAI%20%26lt%3B%20%2521%26nbsp%3B%20THEN%20RESULTS%20%3D%20UNDERWEIGHT)%3C%2FP%3E%3CP%3EAnd%20so%20on.%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20i%20get%20help%20with%20first%20line%20I%20can%20write%20the%20rest.%20thank%20you%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1500563%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1502250%22%20slang%3D%22en-US%22%3ERe%3A%20If%20statement%20help%20needed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1502250%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F714984%22%20target%3D%22_blank%22%3E%40msm66%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EThis%20is%20one%20approach.%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(AND(A2%26gt%3B20%2CA2%26lt%3B39%2CB2%3D%22Female%22%2CC2%26lt%3B21)%3DTRUE%2C%22Underweight%22%2C%22something%20else%22)%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Bennadeau_0-1593640463134.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202740i049877987005FA8E%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22Bennadeau_0-1593640463134.png%22%20alt%3D%22Bennadeau_0-1593640463134.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EHave%20fun%20with%20that.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBen%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1502352%22%20slang%3D%22en-US%22%3ERe%3A%20If%20statement%20help%20needed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1502352%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F714984%22%20target%3D%22_blank%22%3E%40msm66%3C%2FA%3E%26nbsp%3BPlease%20see%20attached%20workbook.%20I%20combined%20the%20check%20for%20both%20men%20and%20women%20and%20all%20age%20ranges%20and%20BAI%20range%20in%20one%20formula%20so%20it%20looks%20a%20bit%20long%20but%20captures%20every%20scenario%20you%20described.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22BAIassessment.png%22%20style%3D%22width%3A%20325px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F202753iF62496D0F99CBD48%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22BAIassessment.png%22%20alt%3D%22BAIassessment.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Capture.JPG

 

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")

Bennadeau_0-1593640463134.png

Have fun with that.

 

Ben

 

Best Response confirmed by msm66 (Contributor)
Solution

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

BAIassessment.png

Thank you very much Ben that was extremely helpful.
hynguyen,
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