Lookup for multiple criteria and duplicate conditions

Graemea

Board Regular
Joined
Oct 30, 2015
Messages
119
Office Version
  1. 365
Platform
  1. Windows
Hi,


I have data arranged in A1:E5 and want to extract values from B3:E5 based on criteria given by the Product Code in A3:A5, the date in
B1:E1 and the Data Type in B2:E2.


The extract forumla references these conditions in cells G1:G3. e.g G1 = AAA, G2 = 31/08/2017 and G3 = Percentile.


The formula I have, which broadly works, is:


{=INDEX($B$3:$E$5,MATCH(1,IF($A$3:$A$5=G1,1),0),MATCH(1,IF($B$1:$E$1=G2,IF($B$2:$E$2=G3,1)),0))}


The wrinkle is that there are two instances in which a column has the same dates in row 1 and same data types in row 2
i.e. C1 and E1 have 31/08/2017 and C2 and E2 both have "Percentile"


As constructed my INDEX MATCH formula above can't distinguish columns C and E when extracting data.


One way to distinguish them is that the second column with these characteristics for a given date (E in my example)
always has a column immediately to the left with the text "Cost of Sales" in its row 2 field (so in D2 in my example).


Can someone please suggest how to alter my formula, above, to accommodate this adjustment.


Thanks!
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Perhaps a simpler way to frame the question would be how could I amend my INDEX MATCH formula to return the result that's in the 2nd column that meets the 3 criteria.

Does anyone know how to do this?

Thanks!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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