Index and Match for unique data

wboney

New Member
Joined
May 6, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I have a workbook that has two sheets. On one sheet (Entries- SEC) is a list of people and events they are participating in as indicated with an "x" on their row under the event titles. On the second sheet (Bareback-SEC), I have a column for MRCA # that I need to fill with each participant who has an "x" under the column labeled BB on the Entries- SEC sheet. I believe that a Index and Match formula should work, but I think it also needs something to bring back all of the participants. As written currently, it only brings back the first instance. This is my first time trying to build using the Index and Match functions.
Formula Issue.xlsx
AB
1MRCA #Contestant Name
23Wayne
33=VLOOKUP(A3,'Entries- SEC'!A:B,2,0)
43Wayne
53Wayne
63Wayne
73Wayne
83Wayne
93Wayne
103Wayne
113Wayne
123Wayne
133Wayne
143Wayne
153Wayne
163Wayne
173Wayne
183Wayne
193Wayne
203Wayne
213Wayne
Bareback-SEC
Cell Formulas
RangeFormula
B2,B4:B21B2=VLOOKUP(A2,'Entries- SEC'!A:B,2,0)
A2:A21A2=INDEX('Entries- SEC'!$A$4:$A$27,MATCH("x",'Entries- SEC'!$G$4:$G$27,0))
Named Ranges
NameRefers ToCells
'Entries- SEC'!_FilterDatabase='Entries- SEC'!$A$3:$U$226B4:B21, B2


Formula Issue.xlsx
ABCDEFGHIJKLMNOP
2Event Entered
3Member #First NameLast NameBranchStatusDate of EntryBBSBBRCDSWTDRGBRBRATRHDTRHE
43Wayne####xxxx
5270Chris####xx
6287Teegan Guy####x
7370Joseph####xxxx
8389Dan####x
9364Caleb####xx
10271Kendall regan ####x
111Adam####xxx
12356Troy ####x
13302Cedric####xx
14300Troy ####x
15387David####xx
16310Cody####xx
17375Harrison####xx
18249Jerrod####xx
19207Greg####x
20223Diana ####xx
21366Lonnie####x
22394Henry "Hank"####xx
23391Jonathon ####xxx
24395Chris####x
25396Robert####x
26390Scott ####x
27384Chad####x
Entries- SEC
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Not sure I got your point, but if you need somewhere the numbers and the names of those that pertecipated to the BB event then use the formula
Excel Formula:
=FILTER('Entries- SEC'!A2:B100,'Entries- SEC'!G2:G100="x")
With the published data, the formula will return 2 columns by 9 rows:
Excel Formula:
  3 Wayne
370 Joseph
364 Caleb
  1 Adam
302 Cedric
387 David
310 Cody
375 Harrison
394 Henry "Hank"
This uses Office 365 FILTER function, FILTER function
 
Upvote 0
Not sure I got your point, but if you need somewhere the numbers and the names of those that pertecipated to the BB event then use the formula
Excel Formula:
=FILTER('Entries- SEC'!A2:B100,'Entries- SEC'!G2:G100="x")
With the published data, the formula will return 2 columns by 9 rows:
Excel Formula:
  3 Wayne
370 Joseph
364 Caleb
  1 Adam
302 Cedric
387 David
310 Cody
375 Harrison
394 Henry "Hank"
This uses Office 365 FILTER function, FILTER function
When I try that formula I get a #SPILL! error. Also, All I need to fill on the sheet is the Column A MRCA #. I can get the actual names to come in from other formulas.
 
Upvote 0
#SPILL means that there is not enough room to insert all the information; try the formula in an empty area to see what it returns
Is MRCA# the info in Entries - Sec!Column A?
 
Last edited:
Upvote 0
When I try that formula I get a #SPILL! error. Also, All I need to fill on the sheet is the Column A MRCA #. I can get the actual names to come in from other formulas.
I can fix the #SPILL! error by putting an @ in front of the formula. But then I'm back to getting just the first instance of the result. In this case, the value 3. I changed the array in your formula to only retrieve column A since I only need the membership #.
Formula Issue.xlsx
AB
1MRCA #Contestant Name
23
33
43
53
63
73
83
93
103
113
123
133
143
153
163
173
183
193
203
213
Bareback-SEC
Cell Formulas
RangeFormula
A2:A21A2=@FILTER('Entries- SEC'!$A$2:$A$100,'Entries- SEC'!$G$2:$G$100="x")
Named Ranges
NameRefers ToCells
'Entries- SEC'!_FilterDatabase='Entries- SEC'!$A$3:$U$226A2:A21
 
Upvote 0
The server was unavailable yesterday evening…
My original formula returns a "dynamic array", ie an array whose size depends on how many lines have to be reported. If some of the area needed are not free then you will get the #SPILL! Error. I guess all the cells now are filled with your "old" formulas, so clearing them should be enough.
The @ modify the meaning of the formula to get only the first row.

Again, to see what the formula tryes to return, insert in in a free area so that the formula can "spill" all its results

If you cannot guarantee that there will be enough free rows in the column where you set the formula, you could add INDEX to get only a limited number of rows.
For example:
Code:
=INDEX(FILTER('Entries- SEC'!A2:A100,'Entries- SEC'!$G$2:$G$100="x"),SEQUENCE(4),0)
This will return 4 lines, as defined by SEQUENCE(4); so modify that 4 to your number of available rows.

However, to prevent that you get a #REF! error in case that the returned array is shorter that your fixed limit, it's is better to envelop the formula with IFERROR:
Code:
=IFERROR(INDEX(FILTER('Entries- SEC'!A2:A100,'Entries- SEC'!$G$2:$G$100="x"),SEQUENCE(14),0),"")
With this formula you set a limit to 14 lines; in case the returned array has less the 14 lines the extra lines will be empty

To make sure that this result is coherent with the "contestant names", I suggest that you use the same formula to extract also those value; it will be sufficient that you copy the formula (the first line) to the next column and it will return datas from Entries- SEC'!B2:B100 (this is the Contestant Name, is it?)
 
Upvote 0
Solution
The server was unavailable yesterday evening…
My original formula returns a "dynamic array", ie an array whose size depends on how many lines have to be reported. If some of the area needed are not free then you will get the #SPILL! Error. I guess all the cells now are filled with your "old" formulas, so clearing them should be enough.
The @ modify the meaning of the formula to get only the first row.

Again, to see what the formula tryes to return, insert in in a free area so that the formula can "spill" all its results

If you cannot guarantee that there will be enough free rows in the column where you set the formula, you could add INDEX to get only a limited number of rows.
For example:
Code:
=INDEX(FILTER('Entries- SEC'!A2:A100,'Entries- SEC'!$G$2:$G$100="x"),SEQUENCE(4),0)
This will return 4 lines, as defined by SEQUENCE(4); so modify that 4 to your number of available rows.

However, to prevent that you get a #REF! error in case that the returned array is shorter that your fixed limit, it's is better to envelop the formula with IFERROR:
Code:
=IFERROR(INDEX(FILTER('Entries- SEC'!A2:A100,'Entries- SEC'!$G$2:$G$100="x"),SEQUENCE(14),0),"")
With this formula you set a limit to 14 lines; in case the returned array has less the 14 lines the extra lines will be empty

To make sure that this result is coherent with the "contestant names", I suggest that you use the same formula to extract also those value; it will be sufficient that you copy the formula (the first line) to the next column and it will return datas from Entries- SEC'!B2:B100 (this is the Contestant Name, is it?)
Thanks Anthony. This worked. It also helped me to understand the dynamic formulas a little better.
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,541
Members
449,089
Latest member
davidcom

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