2D lookup in an array

LaurentT

New Member
Joined
Jun 16, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I'm struggling to find a solution for that problem. I'm looking to lookup on a 2D table made of unit values.
I've made such example below.
I want to parse all rows in below table and find the country associated to an unique identifier.

for instance, if I parse the value 9, I shall get Germany or if I parse 6, I shall get Spain.
All the numbers to parse are on a table with multiple rows



256Spain
348Italy
1912Germany
71114UK


=> I'm expected to get

ItemCountry
4Italy
11UK
2Spain
5Spain
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi & welcome to MrExcel.
As long as the numbers do not appear more than once, try
+Fluff 1.xlsm
ABCDEFGH
1ItemCountry
2256Spain4Italy
3348Italy11UK
41912Germany2Spain
571114UK5Spain
Lists
Cell Formulas
RangeFormula
H2:H5H2=INDEX($D$1:$D$5,SUMPRODUCT(($A$2:$C$5=G2)*(ROW($D$2:$D$5))))
 
Upvote 0
One way ; control+shift+enter

=CONCAT(IF(A1:C4=G2,D1:D4,""))

where G2 houses a unique input value like 4 and A1:C4 houses values like 2;5;6 etc.
 
Upvote 0
I'd suggest using Aladin's solution, it's far better.
 
Upvote 0
One way ; control+shift+enter

=CONCAT(IF(A1:C4=G2,D1:D4,""))

where G2 houses a unique input value like 4 and A1:C4 houses values like 2;5;6 etc.
Though with Microsoft 365, the OP will not require control+shift+enter.
 
Upvote 0
The countries you want to return.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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