match() - lookup value has multiple match

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
I want a user to enter city name is cell H1 then excel will return the row number using Match(). What to do in case we have the lookup value matching many in a column. Thank you.

Enter city name H1= Toronto

[TABLE="width: 192"]
<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl65, width: 64"]name[/TD]
[TD="class: xl65, width: 64"]phone[/TD]
[TD="class: xl65, width: 64"]address[/TD]
[/TR]
[TR]
[TD="class: xl65"]mary1[/TD]
[TD="class: xl65"]62[/TD]
[TD="class: xl65"]toronto[/TD]
[/TR]
[TR]
[TD="class: xl65"]john1[/TD]
[TD="class: xl65"]11[/TD]
[TD="class: xl65"]ottawa[/TD]
[/TR]
[TR]
[TD="class: xl65"]alex1[/TD]
[TD="class: xl65"]33[/TD]
[TD="class: xl65"]montreal[/TD]
[/TR]
[TR]
[TD="class: xl65"]adam1[/TD]
[TD="class: xl65"]66[/TD]
[TD="class: xl65"]toronto[/TD]
[/TR]
[TR]
[TD="class: xl65"]linda1[/TD]
[TD="class: xl65"]1[/TD]
[TD="class: xl65"]ajax[/TD]
[/TR]
[TR]
[TD="class: xl65"]danny1[/TD]
[TD="class: xl65"]51[/TD]
[TD="class: xl65"]toronto[/TD]
[/TR]
[TR]
[TD="class: xl65"]liz1[/TD]
[TD="class: xl65"]79[/TD]
[TD="class: xl65"]ottawa[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi,

Would this help,


Book1
ABCDEFGH
1namephoneaddresstoronto
2mary162torontomary1
3john111ottawaadam1
4alex133montrealdanny1
5adam166toronto 
6linda11ajax
7danny151toronto
8liz179ottawa
Sheet1
Cell Formulas
RangeFormula
H2{=IFERROR(INDEX($A$2:$A$8,SMALL(IF($C$2:$C$8=$H$1,ROW($C$2:$C$8)-ROW($C$2)+1),ROWS($H$1:H1))),"")}
H3{=IFERROR(INDEX($A$2:$A$8,SMALL(IF($C$2:$C$8=$H$1,ROW($C$2:$C$8)-ROW($C$2)+1),ROWS($H$1:H2))),"")}
H4{=IFERROR(INDEX($A$2:$A$8,SMALL(IF($C$2:$C$8=$H$1,ROW($C$2:$C$8)-ROW($C$2)+1),ROWS($H$1:H3))),"")}
H5{=IFERROR(INDEX($A$2:$A$8,SMALL(IF($C$2:$C$8=$H$1,ROW($C$2:$C$8)-ROW($C$2)+1),ROWS($H$1:H4))),"")}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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