Three-way lookup in Excel table

AnneDerks

New Member
Joined
Oct 6, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I have a table with three criteria. Two criteria are stated in columns, and one in a row.
The table looks like this:
1665051121892.png


I want to find a value which matches the three criteria.
For example: I want the value for 'Cembrit Cetris Basic' , SC1 and Permanent. Then a value of 0.3 (cell C3) should be the answer.

This is what I tried:
I tried to use INDEX MATCH to find a certain value. However, it does not work and I get N/A as answer. I tried many other possibilities, but I still cannot figure out how to lookup the value according to the three criteria.

=INDEX(C3:G12,MATCH(1,(Face_material=A3:A12)*(SC =B3:B12),0),MATCH(Load_duration,C2:G2,0))
And then pressing crtl+shift+enter. I gave names to the cells which should be looked up, so that is where the Face_material, SC, and Load_duration stands for.

Can someone please help me?
Thank you in advance.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Welcome to the MrExcel board!

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

See if you could use something like this.

22 10 06.xlsm
ABCDEFG
1
2PermanentLongMediumShortInst
3aSC10.840.60.940.440.91
4SC20.690.220.340.60.7
5bSC10.590.210.950.10.91
6SC20.630.240.810.780.95
7cSC10.630.830.10.670.92
8SC20.150.40.20.930.05
9
10b
11SC2
12Long
130.24
Lookup
Cell Formulas
RangeFormula
A13A13=INDEX(C3:G8,MATCH(A10,A3:A8,0)+(A11="SC2"),MATCH(A12,C2:G2,0))
 
Upvote 0
Solution
Your major problem is the layout of the data.
The layout is not ideal, but it is workable. Peter has already provided a suggestion that works with consistency in the second column. Even without consistency it is still possible with something like this (borrowing Peter's mini sheet).
Book1
ABCDEFG
1
2PermanentLongMediumShortInst
3aSC10.840.60.940.440.91
4SC20.690.220.340.60.7
5bSC10.590.240.950.10.91
6SC20.630.240.810.780.95
7cSC10.630.830.10.670.92
8SC20.150.40.20.930.05
9
10b
11SC2
12Long
130.24
Sheet1
Cell Formulas
RangeFormula
A13A13=LOOKUP(2,1/(IF(A3:A8="",A2:A7,A3:A8)=A10)/(B3:B8=A11),INDEX(C3:G8,,MATCH(A12,C2:G2,0)))
 
Upvote 0
The layout is not ideal, but it is workable. Peter has already provided a suggestion that works with consistency in the second column. Even without consistency it is still possible with something like this (borrowing Peter's mini sheet).
Book1
ABCDEFG
1
2PermanentLongMediumShortInst
3aSC10.840.60.940.440.91
4SC20.690.220.340.60.7
5bSC10.590.240.950.10.91
6SC20.630.240.810.780.95
7cSC10.630.830.10.670.92
8SC20.150.40.20.930.05
9
10b
11SC2
12Long
130.24
Sheet1
Cell Formulas
RangeFormula
A13A13=LOOKUP(2,1/(IF(A3:A8="",A2:A7,A3:A8)=A10)/(B3:B8=A11),INDEX(C3:G8,,MATCH(A12,C2:G2,0)))
Thank you! However, when I now select SC2, it does not work. for SC1 it does work. But I also tried the solution of Peter_SSs and that one works so I think it is solved!
 
Upvote 0
Welcome to the MrExcel board!

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

See if you could use something like this.

22 10 06.xlsm
ABCDEFG
1
2PermanentLongMediumShortInst
3aSC10.840.60.940.440.91
4SC20.690.220.340.60.7
5bSC10.590.210.950.10.91
6SC20.630.240.810.780.95
7cSC10.630.830.10.670.92
8SC20.150.40.20.930.05
9
10b
11SC2
12Long
130.24
Lookup
Cell Formulas
RangeFormula
A13A13=INDEX(C3:G8,MATCH(A10,A3:A8,0)+(A11="SC2"),MATCH(A12,C2:G2,0))
Thank you! This works indeed! I didn't know I could upload a mini Excel, next time I will do this, thank you!
 
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)
 
Upvote 0
when I now select SC2, it does not work. for SC1 it does work.
It is possible that you didn't quite set it up correctly when you tried to apply the method to your actual sheet. Either that, or there is an inconsistency in the pattern of your data.

Whilst my suggestion works as well as Peter's with the example, I did not test it as thoroughly as I should have and there are still times where it will not work as I had intended. The main fail point (which will also apply to Peter's suggestion) would be a variation in the number of options for each material in the SC columns. Whilst both should work correctly with either 1 or 2 options in the SC column, having 3 or more options for any given material will cause them to fail.

As @steve the fish mentioned, the problem lies with the layout of the data. The empty cells in the materials column are not formula friendly. An ideal layout (and the way that most experienced users would set it up) would be with the material name entered into each row that it applies to as shown below, that way the formulas can validate the criteria correctly instead of having to make assumptions that may not always be correct.
PermanentLongMediumShortInst
aSC10.8410.940.440.91
aSC20.6920.340.60.7
bSC10.5930.950.10.91
bSC20.6340.810.780.95
cSC10.6350.10.670.92
cSC20.1560.20.930.05
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,936
Members
449,094
Latest member
teemeren

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