Index Match match match? #REF

orangebloss

Board Regular
Joined
Jun 5, 2013
Messages
51
Office Version
  1. 365
Platform
  1. Windows
I'm trying to look up values based on three criteria - my gut is that this needs to be an array formula but I'm beggared if I can get it to work. My source table looks as follows:


[table="width: 500"]
[tr]
[td]Project[/td]
[td]Category[/td]
[td]1[/td]
[td]2[/td]
[td]3[/td]
[td]4[/td]
[td]5[/td]
[td]6[/td]

[/tr]
[tr]
[td]Project A[/td]
[td]Category A[/td]
[td]9[/td]
[td]4[/td]
[td]3[/td]
[td]6[/td]
[td]0[/td]
[td]2[/td]

[/tr]
[tr]
[td]Project A[/td]
[td]Category B[/td]
[td]7[/td]
[td]3[/td]
[td]2[/td]
[td]7[/td]
[td]5[/td]
[td]6[/td]

[/tr]
[tr]
[td]Project B[/td]
[td]Category A[/td]
[td]5[/td]
[td]4[/td]
[td]3[/td]
[td]9[/td]
[td]7[/td]
[td]8[/td]

[/tr]
[tr]
[td]Project B[/td]
[td]Category B[/td]
[td]9[/td]
[td]1[/td]
[td]8[/td]
[td]2[/td]
[td]7[/td]
[td]3[/td]

[/tr]
[/table]

My Results table looks at the source table and returns the values based on the Project and Category specified in other cells

[table="width: 500"]
[tr]
[td][/td]
[td]A[/td]
[td]B[/td]
[td]C[/td]
[td]D[/td]
[td]E[/td]
[/tr]
[tr]
[td]1[/td]
[td]Project B[/td]
[td][/td]
[td][/td]
[td][/td]
[td][/td]
[/tr]
[tr]
[td]2[/td]
[td]Category[/td]
[td]1[/td]
[td]2[/td]
[td]3[/td]
[td]4[/td]
[/tr]
[tr]
[td]3[/td]
[td]Category A[/td]

[td][/td]
[td][/td]
[td][/td]
[td][/td]
[/tr]
[tr]
[td]4[/td]
[td]Category B[/td]

[td][/td]
[td][/td]
[td][/td]
[td][/td]
[/tr]
[/table]

Which should produce the following results

[table="width: 500"]
[tr]
[td][/td]
[td]A[/td]
[td]B[/td]
[td]C[/td]
[td]D[/td]
[td]E[/td]
[/tr]
[tr]
[td]1[/td]
[td]Project B[/td]
[td][/td]
[td][/td]
[td][/td]
[td][/td]
[/tr]
[tr]
[td]2[/td]
[td]Category[/td]
[td]1[/td]
[td]2[/td]
[td]3[/td]
[td]4[/td]
[/tr]
[tr]
[td]3[/td]
[td]Category A[/td]

[td]5[/td]
[td]4[/td]
[td]3[/td]
[td]9[/td]
[/tr]
[tr]
[td]4[/td]
[td]Category B[/td]

[td]9[/td]
[td]1[/td]
[td]8[/td]
[td]2[/td]
[/tr]
[/table]

Index Match Match doesn't seem to work (presumably as it's all columns?) Any assistance is much appreciated!!

Essentially if the Category, Project and month (values 1 to 4 etc) all match then return the value

Alternatively is there an alternative way to structure my source table?
 
Last edited:

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Sheet1

[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][td]
F​
[/td][td]
G​
[/td][td]
H​
[/td][/tr][tr][td]
1​
[/td][td] Project[/td][td] Category[/td][td] 1[/td][td] 2[/td][td] 3[/td][td] 4[/td][td] 5[/td][td] 6[/td][/tr]
[tr][td]
2​
[/td][td] Project A[/td][td] Category A[/td][td] 9[/td][td] 4[/td][td] 3[/td][td] 6[/td][td] 0[/td][td] 2[/td][/tr]
[tr][td]
3​
[/td][td] Project A[/td][td] Category B[/td][td] 7[/td][td] 3[/td][td] 2[/td][td] 7[/td][td] 5[/td][td] 6[/td][/tr]
[tr][td]
4​
[/td][td] Project B[/td][td] Category A[/td][td] 5[/td][td] 4[/td][td] 3[/td][td] 9[/td][td] 7[/td][td] 8[/td][/tr]
[tr][td]
5​
[/td][td] Project B[/td][td] Category B[/td][td] 9[/td][td] 1[/td][td] 8[/td][td] 2[/td][td] 7[/td][td] 3[/td][/tr]
[/table]


Sheet2

[Table="width:, class:grid"][tr][td]Row\Col[/td][td]
A​
[/td][td]
B​
[/td][td]
C​
[/td][td]
D​
[/td][td]
E​
[/td][/tr][tr][td]
1​
[/td][td] Project B[/td][td] [/td][td] [/td][td] [/td][td] [/td][/tr]
[tr][td]
2​
[/td][td] Category[/td][td] 1[/td][td] 2[/td][td] 3[/td][td] 4[/td][/tr]
[tr][td]
3​
[/td][td] Category A[/td][td] 5[/td][td] 4[/td][td] 3[/td][td] 9[/td][/tr]
[tr][td]
4​
[/td][td] Category B[/td][td] 9[/td][td] 1[/td][td] 8[/td][td] 2[/td][/tr]
[tr][td]
5​
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]


In B3 control+shift+enter, not just enter, copy across, and down:

=INDEX(Sheet1!$C$2:$H$5,MATCH(1,IF(Sheet1!$A$2:$A$5=$A$1,IF(Sheet1!$B$2:$B$5=$A3,1)),0),MATCH(B$2,Sheet1!$C$1:$H$1,0))
 
Upvote 0
You could also try this variation that does not require the array entry, & for me is a little faster (only relevant if you have a lot of these formulas on your sheet).

For the same layout as Aladin posted, in B3 of Sheet2 copied across and down

=INDEX(Sheet1!$C$2:$H$5,MATCH($A$1&"|"&$A3,INDEX(Sheet1!$A$2:$A$5&"|"&Sheet1!$B$2:$B$5,0),0),MATCH(B$2,Sheet1!$C$1:$H$1,0))
 
Upvote 0
Brilliant ! thank you to both of you! I went with the array in the end but both your swift responses are much appreciated!!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
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