Multiple VLookups - Can anyone help me please?

C

certain_death

Hi all

Does anybody know how the formula for a multiple vlookup.
I want to lookup against a pivot table that has various customers i
column B and product categories in column H and a sales value in colum
I.
What I want to do is lookup a particular customer and a particula
product and return the sales value.
EG VLOOKUP (Customer A) and VLOOKUP (Product B) and return the sale
value.
Can anyone help??? Driving me mad!!

Many thanks for looking.
Regards
Mark:
 
M

Max

One way is to put something like, in say J2:
=INDEX($I$2:$I$10,MATCH(1,($B$2:$B$10="Customer A")*($H$2:$H$10="Product
B"),0))
then array-enter the formula, i.e. press CTRL+SHIFT+ENTER
instead of just pressing ENTER

Adapt the ranges to suit ..
(note that entire col ranges cannot be used, eg: B:B, H:H, etc)
 
C

certain_death

Hi Max
Have tried this but am getting the classic #N/A response.
What am I doing wrong?
Here is my formula

=INDEX('Sales and GC'!$I$7:$I$65000,MATCH(1,('Sales and
GC'!$B$7:$B$65000="BOOTS")*('Sales and GC'!$H$7:$H$65000="LIL
DIG"),0))

Anything I'm doing wrong?

Thanks
Mark:)
 
D

Dave Peterson

I'd check the data first.

Do you have Boots in B7:B65000
and do you have LIL DIG in H7:H65000 of that same row with Boots in it?
 
M

Max

Think there's nothing wrong with your adaptation. Assuming there should be
a match/result for the inputs: BOOTS/LIL DIG, then probably the source data
may contain extraneous white spaces (leading, trailing or in-between spaces)
which is throwing the matching off (These spaces are not readily visible).

We could use TRIM around cols B and H to make the matching more robust:
=INDEX('Sales and GC'!$I$7:$I$65000,MATCH(1,(TRIM('Sales and
GC'!$B$7:$B$65000)="BOOTS")*(TRIM('Sales and GC'!$H$7:$H$65000)="LIL
DIG"),0))

(Above array-entered as before)

P/s: Try using the smallest range large enough to cover, for calc
efficiency/performance. Your range is pretty large <g>.
 

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