Lookup question

steve400243

Active Member
Joined
Sep 15, 2016
Messages
435
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
1736454979681.png

Hello, When I enter The City in Cell M2, and State in N2, I need to return the value from Column I in cell O2 as shown above. Thanks for all the help.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
DEFGHIJKLMNO
1
2AberdeenNJAberdeenWAUS GHR
3AberdeenNCUS GHR
4AberdeenSC
5AberdeenWAUS GHR
6AberdeenID
7AberdeenOH
8AberdeenMS
9AberdeenKY
10SpringfieldAR
11SpringfieldCA
12SpringfieldCO
Sheet1
Cell Formulas
RangeFormula
O2O2=INDEX(F2:F12,MATCH(1,(D2:D12=M2)*(E2:E12=N2),))
O3O3=FILTER(F2:F12,(D2:D12=M2)*(E2:E12=N2))
 
Upvote 0
Solution
Try this:

MrExcel_2025-01.xlsm
DEFGHIJKLMNO
1CityStateValue
2AberdeenNJUS AB3AberdeenWAUS GHR
3AberdeenNCUS UAE
4AberdeenSCUS XBA
5AberdeenWAUS GHR
6AberdeenIDUS APD
7AberdeenOHUS AHD
8AberdeenMSUS AEK
9AberdeenKYUS ABK
Sheet1
Cell Formulas
RangeFormula
O2O2=INDEX(I2:I9,XMATCH(M2&N2,D2:D9&E2:E9))
 
Upvote 0
DEFGHIJKLMNO
1
2AberdeenNJAberdeenWAUS GHR
3AberdeenNCUS GHR
4AberdeenSC
5AberdeenWAUS GHR
6AberdeenID
7AberdeenOH
8AberdeenMS
9AberdeenKY
10SpringfieldAR
11SpringfieldCA
12SpringfieldCO
Sheet1
Cell Formulas
RangeFormula
O2O2=INDEX(F2:F12,MATCH(1,(D2:D12=M2)*(E2:E12=N2),))
O3O3=FILTER(F2:F12,(D2:D12=M2)*(E2:E12=N2))
[/RANGE
Cell Formulas
RangeFormula
Thanks for looking at this Stephen, Here is my results using your formula and changing to Column I for the results
1736459542930.png
 
Upvote 0
=INDEX(I2:I12,MATCH(1,(D2:D12=M2)*(E2:E12=N2),)) in cell O2
=FILTER(I2:I12,(D2:D12=M2)*(E2:E12=N2)) In Cell O3
 
Upvote 0
Try this:

MrExcel_2025-01.xlsm
DEFGHIJKLMNO
1CityStateValue
2AberdeenNJUS AB3AberdeenWAUS GHR
3AberdeenNCUS UAE
4AberdeenSCUS XBA
5AberdeenWAUS GHR
6AberdeenIDUS APD
7AberdeenOHUS AHD
8AberdeenMSUS AEK
9AberdeenKYUS ABK
Sheet1
Cell Formulas
RangeFormula
O2O2=INDEX(I2:I9,XMATCH(M2&N2,D2:D9&E2:E9))
Thanks for looking at this Pete, I get an "N/A code using your formula.
1736459707813.png
 
Upvote 0
All three formulae rely on finding an exact match.

Do you perhaps have leading or trailing space characters anywhere, e.g. "Aberdeen " or "WA " rather than "Aberdeen" and "WA"?
 
Upvote 0
Try this:

MrExcel_2025-01.xlsm
DEFGHIJKLMNO
1CityStateValue
2AberdeenNJUS AB3AberdeenWAUS GHR
3AberdeenNCUS UAE
4AberdeenSCUS XBA
5AberdeenWAUS GHR
6AberdeenIDUS APD
7AberdeenOHUS AHD
8AberdeenMSUS AEK
9AberdeenKYUS ABK
Sheet1
Cell Formulas
RangeFormula
O2O2=INDEX(I2:I9,XMATCH(M2&N2,D2:D9&E2:E9))
This worked as needed also Pete, After removing extra space characters. Thank you for the help.
 
Upvote 0

Forum statistics

Threads
1,225,763
Messages
6,186,897
Members
453,384
Latest member
BigShanny

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