Return Multiple Matches Using Index Match.

Promptbeef

New Member
Joined
Jan 11, 2017
Messages
14
Hi there,

I'm looking for a formula to match a value within an array and return the results found.

I know how to you use vlookup/match/index formula's, but I can only return the first match found. I would like to return the first match in cell A1 and the second match inside A2, third inside A3, etc.

So when the first match is found and placed inside A1 then the formula inside A2 should ignore the first match that is already found and show the next match value.

I want to look up "PG" from the all players page and have only the PG appear without #n/a Errors

this is the formula im using {=INDEX('All Players'!B2:B500,MATCH("PG"&'All Players'!B2,'All Players'!A2:A500&'All Players'!B2:B500,0))} and am getting #n/a's between correct matches

I would like to get this done with a formula and not with the autofilter option inside Excel.
This is a basketball table and is a small sample size the actual tables i'm using have over 200 players.

Example of what i want:

1st Page: PGs
PositionName
PGRussell Westbrook
PGIsaiah Thomas
PGJohn Wall

<tbody>
</tbody>

2nd Page: All Players
PositionName
PGRussell Westbrook
SGJames Harden
SFLebron James
PGIsaiah Thomas
CDemarcus Cousins
PGJohn Wall

<tbody>
</tbody>




 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Sheet2 (2nd page)

Row\Col
A​
B​
1​
PositionName
2​
PGRussell Westbrook
3​
SGJames Harden
4​
SFLebron James
5​
PGIsaiah Thomas
6​
CDemarcus Cousins
7​
PGJohn Wall

In what follows, named ranges, that is, Position and Name are used.

Sheet1 (1st page)

Row\Col
A​
B​
1​
PG
3​
2​
PositionPlayer
3​
PGRussell Westbrook
4​
PGIsaiah Thomas
5​
PGJohn Wall
6​
7​

In b1 just enter:

=COUNTIFS(Position,A1)

In A3 just enter and copy down:

=IF($B3="","",$A$1)

In B3 control+shift+enter, not just enter, and copy down:

=IF(ROWS($B$3:B3)>$B$1,"",INDEX(Name,SMALL(IF(Position=$A$1,ROW(Name)-ROW(INDEX(Name,1,1))+1),ROWS($B$3:B3))))
 
Upvote 0
Hey thanks for the reply but not quite what i wanted. I want to leave the spreadsheet as is without adding an extra row. Also is there just something i can add to the formula i was using to delete or not include #n/a, without leaving a blank space? formul

example of how my formula looks.

PositionName
pgRussell Westbrook
#
pgChris Paul
#

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,218,220
Messages
6,141,231
Members
450,344
Latest member
renslaw

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