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

namephoneaddress
mary162toronto
john111ottawa
alex133montreal
adam166toronto
linda11ajax
danny151toronto
liz179ottawa

<colgroup><col width="64" span="3" style="width:48pt"> </colgroup><tbody>
</tbody>
 

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
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,216,574
Messages
6,131,492
Members
449,653
Latest member
aurelius33

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