+ Reply to Thread
Results 1 to 6 of 6

Trouble with Nested IF Function

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Trouble with Nested IF Function

    Hi,

    I am using the below formula to make the range of numbers in Column 1 (R) fall into certain buckets in column 2 (S).
    The numbers range from 0-30.
    I had originally pivoted them and them grouping them by intervals of 5. However now the data is needed in the below format
    0 =
    1-3 =
    4-5 =
    6-10 =
    11-15 =
    16-20 =
    >20 =

    The last four is easy. Its the second and 3rd interval that is throwing me from using a pivot.

    The formula seems to work for some and throws errors for others.

    =IF(R3="0","New",IF(R3>0<4,"1-3","4-5"),IF(R3>5<11,"6-10","11-15"))

    Can you please help me.

    Thanks
    GV

  2. #2
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Trouble with Nested IF Function

    =LOOKUP(R3,{0,1,4,6,11,16,21},{"New","1-3","4-5","6-10","11-15","16-20",">20"})

  3. #3
    Registered User
    Join Date
    01-22-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Trouble with Nested IF Function

    Hi Teethless Mama....I tried the lookup formula but it is throwing #N/A error for all my records. Not sure how to fix it. Can you please help

  4. #4
    Valued Forum Contributor Dunc3142's Avatar
    Join Date
    09-05-2007
    Location
    Franklin OH
    MS-Off Ver
    2000 and 2007 and 2010 @ Home & Teach 2010
    Posts
    351

    Re: Trouble with Nested IF Function

    This works using if statements and adding the strings together.
    Just copy and paste it into your sheet.

    =IF(R1<1,"NEW","")&IF(AND(R1>0,R1<4),"1-3","")&IF(AND(R1>3,R1<6),"4-5","")&IF(AND(R1>5,R1<11),"6-10","")&IF(AND(R1>10,R1<16),"11-15","")&IF(AND(R1>15,R1<21),"16-20","")&IF(R1>20,">20","")
    Yes it will. we just have to figure out how...
    If I have helped you, PLEASE click the * and add to my Rep.
    Also, if the problem is SOLVED please mark it as so.

  5. #5
    Registered User
    Join Date
    01-22-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Trouble with Nested IF Function

    Thank you very much Teethless mama and Dunc3142.

    Both your formulas work...I discovered that the issue is because the numbers that I am looking up in the first column are from a vlookup. Because of this the above formulas were throwing an error.

    To avoid further hassle I have just pasted that data into another tab and ran the formulas off them.

  6. #6
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Trouble with Nested IF Function

    You're Welcome!

+ 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