+ Reply to Thread
Results 1 to 7 of 7

Nested if statements

  1. #1
    Registered User
    Join Date
    09-14-2011
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    19

    Nested if statements

    This is my statement

    =if(D10<=250,1,If(D10<=500,2,if(D10<=750,3,if(D10<=1000,4,if(D10<=1250,5,if(D10<=1500,6,if(D10<1750,7,if(D10<=2000,8,if(D10<=2250,9,if(D10<=2500,10,if(D10<=2750,11,if(D10<=3000,12,if(D10<=3250,13,if(D10<=3500,14,NA))))))))))))))

    is excel limited on the number of nested if statements? if so how do i get around this? It's saying i can only have 8.
    Last edited by jfrey; 10-21-2011 at 02:43 PM.

  2. #2
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: Nested if statements

    Isn't that equation just Roundup(D10/250,0)
    ?
    Going for Guru! Click the Star to the bottom left of this post if I helped!

  3. #3
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: Nested if statements

    But, regardless, to remove imbedded IF statements in the future, you can change it so that each condition is a distinct IF.

    For example:
    IF(D10<=3500,1,0)+IF(D10<=3250,1,0) etc, etc... so that you'd just be adding 1 for each additional 250 or whatever break points you want...

    Alternatively, you may want to look into the SUMPRODUCT command if you have a variety of different breakpoints and changes.

  4. #4
    Forum Contributor
    Join Date
    05-14-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2007
    Posts
    187

    Re: Nested if statements

    Hi,

    Try this formula Instead
    "Formula: =IF(AND(A3>0,A3<=250),1,IF(AND(A3>250,A3<=500),2,IF(AND(A3>500,A3<=1000),3,IF(AND(A3>1000,A3<=1500),4,"NA"))))"

    Regards,

    Veejar

  5. #5
    Registered User
    Join Date
    09-14-2011
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Nested if statements

    that would only let me do 7 statements. I need a scale from 250 to 4500, incraments of 250.

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Nested if statements

    What is wrong with the suggestion in post #2 ? =roundup(d10/250,0)

  7. #7
    Registered User
    Join Date
    09-14-2011
    Location
    Alabama
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Nested if statements

    I wasn't sure how to use the roundup function.

    That worked. I guess there is more than one way to skin a cat.

    Thanks guys!

+ 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