+ Reply to Thread
Results 1 to 3 of 3

nested IF function

Hybrid View

  1. #1
    Registered User
    Join Date
    05-31-2010
    Location
    Moree Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Smile nested IF function

    Hi
    I'm trying to create an IF function where I want to achieve a result if in D3
    0 to 18 = A
    19 to 27 = B
    28 to 36 = C
    36 and over = D
    Obviously the following function is not correct - can anyone help please.

    IF(D3>0,D3<=18,A,IF(AND(D3>18,D3<=27,B,IF(AND(D3>0,D3<=18,C,IF(AND(D3>36,D,)))))))

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,038

    Re: nested IF function

    Here, try this:

    =LOOKUP(D3,{0,19,28,36},{"A","B","C","D"})

    (wich will result you with error if you enter negative number)

    or this

    =LOOKUP(MAX(0,D3),{0,19,28,36},{"A","B","C","D"})

    (wich will return A even for negative numbers)
    Never use Merged Cells in Excel

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: nested IF function

    From an embedded IF perspective....

    An IF will exit upon first TRUE result so you need not repeatedly use prior tests.

    Also we're assuming the value being tested does not reside in the cell you're placing the formula - your post is unclear.

    =IF(D3<=18,"A",IF(D3<=27,"B",IF(D3<=36,"C","D")))

    You might want to validate D3 is a number as well...

+ 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