Look up formula based on two criteria

chmof13

New Member
Joined
Jan 29, 2018
Messages
15
Good afternoon,

I need some assistance on finding a formula! Jumping straight to the point, here is my predicament:

[TABLE="width: 724"]
<tbody>[TR]
[TD]Customer #[/TD]
[TD]Customer Name[/TD]
[TD]Master Price Level[/TD]
[TD]0001[/TD]
[TD]0002[/TD]
[TD]0003[/TD]
[TD]0004[/TD]
[TD]0005[/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD]apple[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]y[/TD]
[TD]ibm[/TD]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]z[/TD]
[TD]dell[/TD]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


I am trying to look up a value under 0001 (D2), 0002 (E2), etc. but it also has to look at Customer # to pick the correct value. For example, customer x will have info under 0001 and 0004 on different cells (same column) but I need those values to be posted with a formula..

Any help would be appreciated!!
 
Last edited:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
You didn't have any values under 0001, 0002 etc. so I put some in this sample.
This is usually called an INDEX MATCH MATCH. See below.


Excel 2010
ABCDEFGH
1Customer #Customer NameMaster Price Level00010002000300040005
2xapple1abcde
3yibm2fghij
4zdell3klmnop
5
6
7
8x0001a
Sheet1
Cell Formulas
RangeFormula
D8=INDEX($A$1:$H$4,MATCH(B8,$A$1:$A$4,0),MATCH(C8,$A$1:$H$1,0))
 
Upvote 0
Scott,

Thank you for the reply! I did not put any values under there because their is no values under there currently, that's what I need the formulas for, do display that data. Here is a sample of the file that I will be pulling information from (it is another sheet in the workbook):


[TABLE="width: 387"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD]CustomerNo[/TD]
[TD]CustomerName[/TD]
[TD]ProductLine[/TD]
[TD](DATA NEEDED)[/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD]apple[/TD]
[TD="align: right"]0001[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]x[/TD]
[TD]apple[/TD]
[TD="align: right"]0003[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]y[/TD]
[TD]ibm[/TD]
[TD="align: right"]0001[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]y[/TD]
[TD]ibm[/TD]
[TD="align: right"]0002[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]z[/TD]
[TD]dell[/TD]
[TD="align: right"]0004[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]z[/TD]
[TD]dell[/TD]
[TD="align: right"]0005[/TD]
[TD="align: right"]4[/TD]
[/TR]
</tbody>[/TABLE]


So the data needed tab will fill in horizontally on the customer name row. Does this make sense?
 
Upvote 0
Hi,

What you posted in Post #3 was never mentioned in OP, and should have been included, so that helpers can understand what you're asking.

Now, if I understand correctly, use D2 formula copied down and across.
If you Don't want 0 (zero)s to show, use D7 formula copied down and across.
Change cell references/range to match your data, add the "other" sheet name to the formulas.


Book1
ABCDEFGH
1Customer #Customer NameMaster Price Level00010002000300040005
2xapple120300
3yibm212000
4zdell300034
5
6Customer #Customer NameMaster Price Level00010002000300040005
7xapple123
8yibm212
9zdell334
10
11CustomerNoCustomerNameProductLine(DATA NEEDED)
12xapple00012
13xapple00033
14yibm00011
15yibm00022
16zdell00043
17zdell00054
Sheet196
Cell Formulas
RangeFormula
D2=SUMPRODUCT(($A$12:$A$17=$A2)*($C$12:$C$17=D$1)*$D$12:$D$17)
D7=IF(SUMPRODUCT(($A$12:$A$17=$A7)*($C$12:$C$17=D$1)*$D$12:$D$17)=0,"",SUMPRODUCT(($A$12:$A$17=$A7)*($C$12:$C$17=D$1)*$D$12:$D$17))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top