+ Reply to Thread
Results 1 to 2 of 2

Formula too long - Nested IF statement with VLOOKUP

  1. #1
    Registered User
    Join Date
    10-26-2006
    Posts
    1

    Formula too long - Nested IF statement with VLOOKUP

    I have written a formula using a nested IF excel function. It tests a cell for a particular string and returns a "looked-up" value according to that test.

    This works fine BUT.... i need to add more testing conditions to the IF statement.

    Can anyone give me a clue how to condense this formula or do something like a CASE statement which will not restrict the number of IF tests that i can perform?

    =IF((ISNUMBER(SEARCH(" LS",A3))),VLOOKUP("LS",AR1:AS9,2,0),IF((ISNUMBER(SEARCH(" NLS",A3))),VLOOKUP("NLS",Sheet2!$A$2:$B$12,2,0),IF((ISNUMBER(SEARCH(" TQ",A3))),VLOOKUP("TQ",Sheet2!$A$2:$B$12,2,0),IF((ISNUMBER(SEARCH(" KS",A3))),VLOOKUP("KS",Sheet2!$A$2:$B$12,2,0),IF((ISNUMBER(SEARCH(" DB",A3))),VLOOKUP("DB",Sheet2!$A$2:$B$12,2,0),IF((ISNUMBER(SEARCH(" LD",A3))),VLOOKUP("LD",Sheet2!$A$2:$B$12,2,0),"900x1900mm"))))))

    Data in the Sheet2 array is:
    Size Name Dimensions
    LS 900x2030mm
    KS 1070x2030mm
    TQ 1070x1900mm
    NLS 760x2030mm
    DB 1370x1900mm
    LD 1370x2030mm
    QU 1520x2030mm
    KG 1830x2030mm
    DQ 1520x2030mm
    DK 1830x2030mm
    KC 1520x2030mm
    QC 1830x2030mm

    An example of data in the cell being tested is:
    FHC321 LS
    FHC321 NLS
    FHC321 KS
    FHC321 LD
    FHC321 QU
    FHC321 KG
    FHC321 DQ
    FHC321 DK
    FHC321 QC
    FHC321 KC
    FHC321C LS
    FHC321C NLS
    FLE321 NLS
    FLE321 LS
    FLE321 KS
    FLE321 LD
    FLE321 QU

    So, I need to add tests for QU to QC in my lookup table.

    Your help is much appreciated.

    Regards, FurniKing

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    http://www.excelforum.com/showthread...hlight=vlookup
    http://www.excelforum.com/showthread...hlight=vlookup
    http://www.excelforum.com/showthread...hlight=vlookup
    http://www.excelforum.com/showthread...hlight=vlookup

    Here are some post on the subject of VLOOKUP maybe it can help you out, you shouldn't have to use the if statements if you are using vlookup, you just need to set the criteria to a reference cell

+ 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