Look up on multiple criteria

Tho Pham

New Member
Joined
Dec 17, 2018
Messages
3
Hello community,

I have kind of a noob question here.

CityDistrictInformationCity (X)District (Y)Urban(1)/Rural (2)
12111
11122
12131
23211
22221
13232
23
21

<tbody>
</tbody>

In the right is a "directory" - the information that a district of a city is urban or rural is unique.

I want to generate a formula that helps sort the information on the left:
if (city = X) and (district = Y) then the vale of urban (1) or rural (2) would be displayed on the column "Information".

Hope the noob me has made the question clear.

Thank you for all your time on my question!
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Welcome to the forum.

Try:

ABCDEFGHI
1CityDistrictInformationCity (X)District (Y)Urban(1)/Rural (2)
21222111
31111122
41222131
52322211
62211221
71311232
82322
92111

<tbody>
</tbody>
Sheet15

Worksheet Formulas
CellFormula
D2=SUMIFS($H$2:$H$7,$F$2:$F$7,A2,$G$2:$G$7,B2)

<tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
C2{=INDEX($H$2:$H$7,MATCH(A2&"|"&B2,$F$2:$F$7&"|"&$G$2:$G$7,0))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>







The C2 formula is an array formula and requires Control+Shift+Enter, and will work for numeric results as well as character results. The D2 formula is a regular formula and a bit shorter, but it only works if the result is numeric.
 
Last edited:
Upvote 0
Dear Eric,

You are a life saver.
Thank you a lot for all your time on helping me out. It's so kind of you.

Wish you all the best.
 
Upvote 0

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

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