+ Reply to Thread
Results 1 to 4 of 4

Nested IF or IF(AND formula needed please

  1. #1
    Registered User
    Join Date
    11-06-2013
    Location
    Queensland, Australia
    MS-Off Ver
    Excel 2011
    Posts
    21

    Nested IF or IF(AND formula needed please

    Here's what I've come up with and I hope I am close as it's great fun to try to work this out for myself. The first section on it's own works just fine but not when I've added the second IF(AND

    =IF(AND(I4>0,I4<9),"5.0-5.5","0"),IF(AND(I4=9,I4<12),"5.6-6","0"),IF(AND(I4=12,I4<15),"6.1-6.5","0")

    My requirement is:
    If I4 is greater than 0 but less than or = to 8 then G4 will show 5.0-5.5
    If I4 is greater than 8 but less than 12 then G4 will show 5.6-6
    If I4 is greater than 11 but less than 15 then G4 will show 6.1-6.5

    If there is nothing in I4 then G4 will show 0

    Attached is my spreadsheet unlocked (hopefully).
    Attached Files Attached Files

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,647

    Re: Nested IF or IF(AND formula needed please

    May be this.......

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Nested IF or IF(AND formula needed please

    hi rwalker. maybe:
    =IF(AND(I4>0,I4<9),"5.0-5.5",IF(AND(I4=9,I4<12),"5.6-6",IF(AND(I4=12,I4<15),"6.1-6.5","0")))

    if you were building the formula parts by parts, you notice that the screen tip is always bold when you are filling in the argument:
    =IF(logical_test,[value_if_true],[value_if_false])

    so when you did up to this portion:
    =IF(AND(I4>0,I4<9),"5.0-5.5","0")

    did you notice that you have ended the formula? that's why Excel couldn't evaluate anymore & gave you a VALUE error. so IF the 1st statement is TRUE, return "5.0-5.5". if it's FALSE, do another IF statement:
    =IF(AND(I4>0,I4<9),"5.0-5.5",IF(AND(I4=9,I4<12),"5.6-6",

    and continue on...

    you could actually shorten it further because the IF formula eliminates from the left to the right. that means IF I4 is 1-8, you would have got your answer & the IF formula stops calculating. IF it fails, you no longer have to test for 1-8:
    =IF(OR(I4>=15,I4<=0),"0",IF(I4<9,"5.0-5.5",IF(I4<12,"5.6-6","6.1-6.5")))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Registered User
    Join Date
    11-06-2013
    Location
    Queensland, Australia
    MS-Off Ver
    Excel 2011
    Posts
    21

    Re: Nested IF or IF(AND formula needed please

    Oh, Thank you both so much. It's such fun learning excel and trying to find answers. For a start that's great that I had it sort of right but had closed the first section. And a bonus to shorten it up - I've learned!
    Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help needed top break the complex nested if formula
    By chandra 2185 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-07-2013, 02:50 PM
  2. Nested VLookup, Match Formula Help Needed
    By jealkon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-08-2013, 02:18 PM
  3. [SOLVED] Nested Formula - Additional Help needed
    By jealkon in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-28-2012, 02:56 PM
  4. Nested If Formula Help Needed
    By johnsor1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-26-2012, 09:34 AM
  5. Nested IF or LOOKUP Formula needed?
    By shudder in forum Excel General
    Replies: 6
    Last Post: 09-14-2009, 11:12 AM

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