Reverse lookup

ExcelNewbie2020

Active Member
Joined
Dec 3, 2020
Messages
289
Office Version
  1. 365
Platform
  1. Windows
usually the lookup value is within the single column/rows and the return array can be find from the multiple column/rows..
how can we lookup if the scenario would be like this?

lookup value is from 1 to 15 the return value is from A to D..thanks

A​
1​
2​
3​
4​
B​
5​
6​
7​
8​
LOOKUP VALUE​
6
C​
9​
10​
11​
12​
EXPECTED RESULT​
B
D​
13​
14​
15​
16​
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
How about
Fluff.xlsm
ABCDEFGH
1
2A1234
3B5678LOOKUP VALUE6
4C9101112EXPECTED RESULTB
5D13141516
Main
Cell Formulas
RangeFormula
H4H4=INDEX(A:A,AGGREGATE(15,6,ROW(A2:A5)/(B2:E5=H3),1))
 
Upvote 0
Solution
How about
Fluff.xlsm
ABCDEFGH
1
2A1234
3B5678LOOKUP VALUE6
4C9101112EXPECTED RESULTB
5D13141516
Main
Cell Formulas
RangeFormula
H4H4=INDEX(A:A,AGGREGATE(15,6,ROW(A2:A5)/(B2:E5=H3),1))
cool.. thanks man, really appreciated
 
Upvote 0
Book1
ABCDEFGH
1A1234
2B5678LOOKUP VALUE6
3C9101112EXPECTED RESULTB
4D13141516
Sheet9
Cell Formulas
RangeFormula
H3H3=TOCOL(IF(B:E=H2,A:A,NA()),3)


If multiple cells could be returned and you'd only be interested in the last possible value, then try to the nest above in TAKE():

Excel Formula:
=TAKE(TOCOL(IF(B:E=H2,A:A,NA()),3),-1)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
If the lookup value will be unique then you could use this H4 formula.
If the lookup value might be repeated and you wanted all relevant 'row headings', perhaps H10

23 01 31.xlsm
ABCDEFGH
1
2A1234
3B5678LOOKUP VALUE6
4C9101112EXPECTED RESULTB
5D13141516
6
7
8A1234
9B5678LOOKUP VALUE6
10C610612EXPECTED RESULTB,C
11D13141516
Lookup
Cell Formulas
RangeFormula
H4H4=CONCAT(IF(B2:E5=H3,A2:A5,""))
H10H10=TEXTJOIN(",",1,UNIQUE(TOCOL(IF(B8:E11=H9,A8:A11,""))))


@JvdV
I can see my Excel 'think' about those whole column reference formulas.
 
Upvote 0

Forum statistics

Threads
1,215,013
Messages
6,122,694
Members
449,092
Latest member
snoom82

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