+ Reply to Thread
Results 1 to 12 of 12

multiple conditions

  1. #1
    Registered User
    Join Date
    12-04-2006
    Posts
    9

    multiple conditions

    I need a particular cell (we'll say A25) to return a value of 1,2,3 or 4 depending on the following conditions:

    Returns 1 IF (G15="L" and H15="I" and K15="P") otherwise........
    Returns 2 IF (G15="L" and H15="I" and K15="S") otherwise........
    Returns 3 IF (G15="L" and H15="N" and K15="P") otherwise........
    Returns 4 IF (G15="L" and H15="N" and K15="S") and finally........
    Leaves blank IF (G15="A")

    I've tried nesting IF statements but obvously I have more than 7!

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    There are only 5 IF's so you could use this

    =IF(G15="","A",IF(AND(G15="L",H15="I",K15="P"),1,IF(AND(G15="L",H15="I",K15="S"),2,IF(AND(G15="L",H15="N",K15="P"),3,IF(AND(G15="L",H15="N",K15="S"),4,0)))))
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Registered User
    Join Date
    12-04-2006
    Posts
    9

    Works great but....

    How would I alter this to recognize a series of numbers insted of "P"

    For instance, in the first IF(AND statement I need K15= to recognize the values 1-4 instead of "P"

    Thanks for the help

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Do you still want it to return 1 if TRUE for L I, and 3 if TRUE for L N, if so then

    =IF(G15="","A",IF(AND(G15="L",H15="I"),IF(OR(K15=1,K15=2,K15=3,K15=4),1,0),IF(AND(G15="L",H15="I",K15="S"),2,IF(AND(G15="L",H15="N"),IF(OR(K15=1,K15=2,K15=3,K15=4),3,0),IF(AND(G15="L",H15="N",K15="S"),4,0)))))
    Last edited by oldchippy; 12-04-2006 at 12:02 PM.

  5. #5
    Registered User
    Join Date
    12-04-2006
    Posts
    9

    Got It!

    Works perfectly........thanks a lot

  6. #6
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    No problem - thanks for the feedback

  7. #7
    Registered User
    Join Date
    12-04-2006
    Posts
    9

    One more multiple

    1=Primed
    2=White
    3=Linen White
    4=Univ. White
    5=BLK Walnut
    6=Fruitwood
    7=Teak
    8=Maple
    9=Prov
    10=Span Oak
    11=White Oak
    12=Clear

    =IF(C15=1,"Primed",IF(C15=2,"White",IF(C15=3,"Linen White".........and so on. Its my understanding that I cannot nest this entire formula in this format.

    Could you offer another suggestion?

  8. #8
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Take a look at this previously answered question on multiple colours

    http://www.excelforum.com/showthread.php?t=582266

  9. #9
    Registered User
    Join Date
    12-04-2006
    Posts
    9

    Not understanding

    Thanks for the suggestions........but I'm afraid it didn't make any sense to me. Is there another way without using VBA?

  10. #10
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Sorry, sent you up the wrong path completely there. I was in a hurry to get home and didn't read it properly.

    Try this, if you have your list 1-12 and different finishes in say A1:B12, then you can use a vlookup

    =VLOOKUP(C15,A1:B12,2)

  11. #11
    Registered User
    Join Date
    12-04-2006
    Posts
    9
    Thanks.......it works perfectly

  12. #12
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Good - Glad we got there in the end. Thanks for the feedback.

+ 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