+ Reply to Thread
Results 1 to 16 of 16

Nested If Formulae

Hybrid View

  1. #1
    Registered User
    Join Date
    07-15-2009
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Nested If Formulae

    I'm afraid that comes down to my ignorance again. What I am trying to say is if cell O9 starts with "DBC" then make cell Q9 150. I didnt think that you ould use wildcards with if statements so I attempted this as an alternative. I understand that this may not be correct. Can you suggest an alternative? I do need to account for the possibility that O9 may be blank as well!!

    Many thanks again,

    Stan

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Nested If Formulae

    Then try:

    =IF(LEFT(O9,3)="DBC",150,IF(ISNA(IF(O9<>"",IF(LEFT(O9)="B",VLOOKUP(MID(O9,2,4)+0,COMPSB!A:AP,42,FALSE),IF(E9<>"",IF(E9="New",VLOOKUP(O9,'COMPSW-NS'!D:AP,35,FALSE),IF(E9="OLD",VLOOKUP(O9,'COMPSW-OS'!D:AP,35,FALSE),"")),"")),"")),"",IF(O9<>"",IF(LEFT(O9)="B",VLOOKUP(MID(O9,2,4)+0,COMPSB!A:AP,42,FALSE),IF(E9<>"",IF(E9="New",VLOOKUP(O9,'COMPSW-NS'!D:AP,35,FALSE),IF(E9="OLD",VLOOKUP(O9,'COMPSW-OS'!D:AP,35,FALSE),"")),"")),"")))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    07-15-2009
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2010
    Posts
    10

    Unhappy Re: Nested If Formulae

    For some reason. it does nnot like that formulae. Have you tried pasting this in the sample workbook that I uploaded?

    thanks again,

    Stan

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Nested If Formulae

    Okay try:

    =IF(LEFT(O9,3)="DBC",150,IF(ISNA(IF(O9<>"",IF(LEFT(O9)="B",VLOOKUP(MID(O9,2,4)+0,COMPSB!A:AP,42,FALSE),IF(E9<>"",IF(E9="New",VLOOKUP(O9,'COMPSW-NS'!D:AP,35,FALSE),VLOOKUP(O9,'COMPSW-OS'!D:AP,35,FALSE)),"")),"")),"",IF(O9<>"",IF(LEFT(O9)="B",VLOOKUP(MID(O9,2,4)+0,COMPSB!A:AP,42,FALSE),IF(E9<>"",IF(E9="New",VLOOKUP(O9,'COMPSW-NS'!D:AP,35,FALSE),VLOOKUP(O9,'COMPSW-OS'!D:AP,35,FALSE)),"")),"")))
    or shorter and probably more efficient:

    =IF(LEFT(O9,3)="DBC",150,LOOKUP(9.999999999E+307,CHOOSE({1,2},0,IF(O9<>"",IF(LEFT(O9)="B",VLOOKUP(MID(O9,2,4)+0,COMPSB!A:AP,42,FALSE),IF(E9<>"",IF(E9="New",VLOOKUP(O9,'COMPSW-NS'!D:AP,35,FALSE),VLOOKUP(O9,'COMPSW-OS'!D:AP,35,FALSE)),"")),""))))
    this last formula will return 0, if the Vlookup() results are #N/A... so you can format that cell as 0;-0;;@ to blank out the 0.

+ 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