+ Reply to Thread
Results 1 to 3 of 3

Multiple Nested IF(AND's in a formula

Hybrid View

  1. #1
    Registered User
    Join Date
    05-21-2008
    Posts
    9

    Multiple Nested IF(AND's in a formula

    Hi Everyone,
    I am new to Excel formulas and am trying to figure out a foruma to calculate Body Fat Percentage. I have two columns, AGE and BF%. I need a formula that does the following:

    IF Age >18, <39 AND BMI >7%, <19%, Then return an "L" into 4th column
    IF Age >18, <39 AND BMI >19%, Then return an "H" into 4th column
    IF Age >40, <59 AND BMI >14%, <23%, Then return an "L" into 4th column
    IF Age >40, <59 AND BMI >23%, Then return an "H" into 4th column
    IF Age >60 AND BMI >15%, <24%, Then return an "L" into 4th column
    IF Age >60 AND BMI >24%, Then return an "H" into 4th column

    So far I have:
    =IF(AND(B2>=18,B2<=39,C2>=14,C2<=23),"L","H")*OR(IF(AND(B2>=40,B2<=59,C2>=18,C2>=30),"L","H")*OR(IF(AND(B2>=60,C2>=21,C2>=31),"L","H")))
    but all that returns is a #VALUE in the cell. Could anyone please help with this formula?
    Thanks!
    jwm

  2. #2
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Something like

    =IF(AND(B2>60,C2>24%),"H",IF(AND(B2>60,C2>15%,C2<24%),"L",IF(AND(B2>40,C2>23%),"H",IF(AND(B2>40,B2<59,C2>14%,C2<23%),"L",IF(AND(B2>18,B2<39,C2>19%),"H",IF(AND(B2>18,C2>7%,B2<19%),"L","What"))))))
    This could be simplified further by using OR combinations where the result is going to be the same to reduce the number of IF statements.

    As a general rule start with the last condition and work backworks
    Last edited by EdMac; 05-21-2008 at 11:12 AM.
    Ed
    _____________________________
    Always learning, but never enough!
    _____________________________

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699
    Try this formula

    =IF(AND(B2>=18,B2<=39), IF(C2>0.19,"H", IF(C2>0.07,"L","")), IF(AND(B2>=40,B2<=59), IF(C2>0.23,"H", IF(C2>0.14,"L","")), IF(B2>=60, IF(C2>0.24,"H", IF(C2>0.15,"L","")),"")))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1