+ Reply to Thread
Results 1 to 6 of 6

Stringing together multiple 'if's

  1. #1
    Registered User
    Join Date
    02-09-2005
    Posts
    22

    Stringing together multiple 'if's

    I have this =IF(F3=15.5,"D")
    If want it to check if f3 is a certain number, if so display 'd'. That works. But then I want it to also check if f3=13.5, and if so display 'p'. So on and so forth. So basically, sting together a bunch of checks like that, where if it's a certain number, it displays a certain letter.

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    3,993
    Hi,

    It depends a lot on ...
    and so on ...
    Beyond 7 nested If's there is limit ...
    Quite often, when facing too many if's the solution is using a vlookup() function ...
    HTH
    Carim


    Top Excel Links

  3. #3
    Registered User
    Join Date
    02-09-2005
    Posts
    22
    I won't be going beyond 7. So how would I nest, lets say 5?

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    3,993
    see Chip's explanation ...
    http://www.cpearson.com/excel/nested.htm

  5. #5
    Registered User
    Join Date
    02-09-2005
    Posts
    22
    Thanks!

  6. #6
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,799
    I have this =IF(F3=15.5,"D")
    If want it to check if f3 is a certain number, if so display 'd'. That works. But then I want it to also check if f3=13.5, and if so display 'p'.
    If you're looking for:15.5, 13.5, 11.5, 9.5, 7.5
    and want to display, respectively: D, P, Q, Z, M

    =IF(F3=15.5,"D",IF(F3=13.5,"P",IF(F3=11.5,"Q",IF(F3=9.5,"Z", IF(F3=7.5,"M","")))))

    ----------------
    Note: This takes into account if there is more than just those 5 values in F3 possible. For any value in F3 other than those specified, it will return a blank cell. If only those five values would ever been in F3, then the formula can be shortened a little to:

    =IF(F3=15.5,"D",IF(F3=13.5,"P",IF(F3=11.5,"Q",IF(F3=9.5,"Z","M"))))

    This is because if the value isn't 15.5, 13.5, 11.5 or 9.5, it will be assumed that the value is 7.5, and will return "M".
    ----------------

+ 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