Complex lookup problem

phmalu

Board Regular
Joined
Jun 21, 2017
Messages
52
Office Version
  1. 2019
Platform
  1. Windows
The objective is to be able to find "Result1" and "Result2" (in this case columns P and Q) based on user input values for "case1" to "case6" (A to F). It's important to use all 6 input values because there are many cells with the same value. Finding the correct match is only possible this way.
Vlookup_test.xlsx
ABCDEFGHIJKLMNOPQ
1case1case2case3case4case5case6Result1Result2
2122127rf071jd022All those are user input (fed into the formula)Formula must find
3132440rf067jd099case1case2case3case4case5case6Result1Result2
4255213rf070jd028E.g. 1122127????
5265254rf066jd030E.g. 2528187ErrorError
6312509rf056jd031
7314509rf056jd057
8421335rf038jd026
9421337rf072jd026
10529187rf071jd043
Sheet1

Things to consider:
All columns can have one or more doubled values. However, once you combine all the input data from "case1" to "case6", the pair "Result1" and "Result2" will be unique.
If invalid data is inserted, an error must pop-up rather then use approximate match.

Thanks to all!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
How about
+Fluff 1.xlsm
ABCDEFGHIJKLMNOPQ
1case1case2case3case4case5case6Result1Result2
2122127rf071jd022All those are user input (fed into the formula)Formula must find
3132440rf067jd099case1case2case3case4case5case6Result1Result2
4255213rf070jd028E.g. 1122127rf071jd022
5265254rf066jd030E.g. 2528187ErrorError
6312509rf056jd031
7314509rf056jd057
8421335rf038jd026
9421337rf072jd026
10529187rf071jd043
11
Main
Cell Formulas
RangeFormula
P4:Q5P4=IFNA(INDEX(G$2:G$10,MATCH(1,($A$2:$A$10=$J4)*($B$2:$B$10=$K4)*($C$2:$C$10=$L4)*($D$2:$D$10=$M4)*($E$2:$E$10=$N4)*($F$2:$F$10=$O4),0)),"Error")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
How about
+Fluff 1.xlsm
ABCDEFGHIJKLMNOPQ
1case1case2case3case4case5case6Result1Result2
2122127rf071jd022All those are user input (fed into the formula)Formula must find
3132440rf067jd099case1case2case3case4case5case6Result1Result2
4255213rf070jd028E.g. 1122127rf071jd022
5265254rf066jd030E.g. 2528187ErrorError
6312509rf056jd031
7314509rf056jd057
8421335rf038jd026
9421337rf072jd026
10529187rf071jd043
11
Main
Cell Formulas
RangeFormula
P4:Q5P4=IFNA(INDEX(G$2:G$10,MATCH(1,($A$2:$A$10=$J4)*($B$2:$B$10=$K4)*($C$2:$C$10=$L4)*($D$2:$D$10=$M4)*($E$2:$E$10=$N4)*($F$2:$F$10=$O4),0)),"Error")
Press CTRL+SHIFT+ENTER to enter array formulas.
I was able to solve the problem in a very sloppy way by combining all "case" cells so they become big unique numbers. Then I've used this auxiliary column to perform a reg VLOOKUP.
However, I must say your formula is a lot more elegant and easier to debug in the long run. Thank you so much, that's what I wanted in the first place but was unable to figure out on my own (big lookup formulas are always a bit troublesome).
10/10
 
Upvote 0
You're welcome & thanks for the feedback.
 
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