View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
dakota park dakota park is offline
external usenet poster
 
Posts: 8
Default IF statement with multiple VLOOKUPs

On Friday, October 9, 2015 at 11:26:57 AM UTC-5, Peter T wrote:
If I follow, adapt your formula like this

=If(IsError(mylookup1)=FALSE, "MODERATE",
If(IsError(mylookup2)=FALSE, "UPPER",
If(IsError(...etc

If you flip the True/False arg's you could dispense with the respective
=FALSE, though maybe harder to read

Regards,
Peter T


"dakota park" wrote in message
news:8a7c7353-089e-43f9-a684-77ffb82...
I have a table with the top row headers (classifications) of "LOW,"
"MIDDLE," "MODERATE," "UPPER," & "UNKNOWN." Under each are random
(identification) numbers (e.g. under "LOW" there may be 1103, 1105, 1107.1,
1108.2, etc.).

On the subject chart, I have a column of account numbers, a column of
corresponding identification numbers, and then the classification. What I am
having trouble building, is an if statement with a vlookup which will return
the matching classification.

An example of the formula I could use to get a returning "MIDDLE" value if
the identification matches that classification is this:

=IF(VLOOKUP(B2,'Categories (2)'!B:B,1,FALSE)=B2,"MIDDLE", "NOT FOUND")

B2 refers to the subject chart's identification numbers, and the categories
worksheet column B is the column associated with the "MIDDLE" classification
and the identification numbers below it.

I want to build an if statement that will return the classification and
search all columns of the 1st chart.

This was my closest guess, but it only searches the "MIDDLE" column, and
only returns a value if it is a "MIDDLE" match:

=IF(VLOOKUP(B2,'Categories
(2)'!B:B,1,FALSE)=B2,"MIDDLE",IF(VLOOKUP(B2,'Categ ories
(2)'!$D$1:$D$96,1,FALSE)=B2,"UPPER",IF(VLOOKUP(B2, 'Categories
(2)'!$C$1:$C$55,1,FALSE)=B2,"MODERATE",IF(VLOOKUP( B2,'Categories
(2)'!$A$1:$A$21,1,FALSE)=B2,"LOW",IF(VLOOKUP(B2,'C ategories
(2)'!$E$1:$E$4,1,FALSE)=B2,"UNKNOWN","NOT FOUND")))))

For every "MIDDLE" match, it returns "MIDDLE," but for everything else, I
receive back "#N/A."

Any help would be thoroughly appreciated! Thanks!


Thanks Peter! This formula also worked! I appreciate the help, and hope to continue to figure out all of these formulas and how to work!