Vlookup cells in combination of two columns (both in the lookup value AND table array)

C

Corrie

I am trying to match information in multiple columns (lookup value) to
the same multiple columns in the table array. If the combinations
don't match then I'd like the return to be #N/A. I think an example
can better clarify what I'm trying to accomplish because I haven't a
clue whether I can do it...

On the lookup worksheet I have...
A1 B1
12345 Closeout
12345 First Fill
22233 First Fill
22233 Closeout

On table array worksheet I only have one entry.
A1 B1
12345 Closeout
22233 First Fill

I would like the return to be...
A1 B1 C1
12345 Closeout Y
12345 First Fill #N/A
22233 First Fill Y
22233 Closeout #N/A

I would like the lookup value to combine A1 and B1 and look for that
exact combination on the table array worksheet.

This may be very simple but I am stumped.

Any help is greatly appreciated
 
C

CLR

Insert a new helper column before column A of your table array so your data
is in columns B and C....then in A1 put this and copy down........=B1&C1

then for your lookup formula on the lookup worksheet, use this in C1 and
copy down

=VLOOKUP(a1&b1,'TABLE ARRAY'!A:C,3,FALSE)

Vaya con Dios,
Chuck, CABGx3
 
C

Corrie

Wow. That seemed to work. Looking at what you suggested, I don't
understand the logic of it. Would you mind explaining why having
another column with B1&C1 would help find what you are looking for in
two different columns?

Thanks!
 
C

CLR

You were interested only in rows that had a specific value in column A,
matching with another specific value in column B....well, by CONCATENATING
the two columns together in the lookup array, the VLOOKUP formula only has
to search one column (which is all it can do) to find a row with the
combination you're looking for..........

hth
Vaya con Dios,
Chuck, CABGx3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top