Index Match

j4ymf

Well-known Member
Joined
Apr 28, 2003
Messages
741
Office Version
  1. 365
Platform
  1. Windows
Hello

I was wondering how would i change this formula
Currently it looks to match the Name in B8 to the ones in F:F and return the value in row 3.

I would like it to return if there are more that one answer to return the answer,

currently it returns my answer as 7718 - Student Castle Cambridge if i have 2 different answers can it return it like ? 7718 - Student Castle Cambridge - 7289 - Student Castle London


VBA Code:
=IFNA(INDEX(Download!$B$1:$Q$9999,MATCH(B8,Download!$F$1:$F$9999,0),3),"")

many thanks Jason
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
VBA Code:
=IFNA(INDEX(Download!$B$1:$Q$9999,MATCH(B8,Download!$F$1:$F$9999,0),3),"")

or how do i use this code to match the second answer in the list

thank you
 
Upvote 0
What version of Excel are you using? If it's Excel 365 do you have the FILTER function?
 
Upvote 0
Annotation 2020-06-11 191056.jpg


Hello AhoyNC

Not sure what version im using but after asking my first question i now realise that i would like to create a sheet that looks like this
the first result works OK and returns 7718 - Student Castle Cambridge

how do i change the formula so i can use it in the Site 2 cell

Does that make sense

So i need a formula that matches the first answer in the list and the second answer

Thank you
 
Upvote 0
You can try something like this which will work with Excel ver. 2010 or later. You can find your version by going to FILE - Account.

Book1
ABCDEFG
7
8Joe Bloggs7718 - Student Castle CambridgeJoe Bloggs
9Test1Sam Jones
10Test2Judy May
117289 - Student Castle LondonJoe Bloggs
12Test4Paul Jones
13
14
15TotalJN- Site 1LWSR% WageJN- Site 2
16Joe Bloggs7718 - Student Castle Cambridge7289 - Student Castle London
Sheet1
Cell Formulas
RangeFormula
C16C16=IFERROR(INDEX($C$8:$C$12,AGGREGATE(15,6,(ROW($C$8:$C$12)-ROW($C$8)+1)/($F$8:$F$12=$B16),1)),"")
G16G16=IFERROR(INDEX($C$8:$C$12,AGGREGATE(15,6,(ROW($C$8:$C$12)-ROW($C$8)+1)/($F$8:$F$12=$B16),2)),"")
 
Upvote 0
Thank you AhoyNC
your a star


Im trying to understand the code, what does the AGGREGATE(15,6,

15,6 mean?
 
Upvote 0
hello AhoyNC

thank you
Code:
=IFERROR(INDEX(Download!$D$1:$D$9999,AGGREGATE(15,6,(ROW(Download!$D$1:$D$9999)-ROW(Download!$D$1)+1)/(Download!$F$1:$F$9999=B22),35)),"")

I have had a play and changed it to my RANGE and i needed to change the last bit to get the correct answer to 35

if i have a long list im looking for the next different name to the first, not always the second in the list

thank you in advance
 
Upvote 0
The 15 is the option for aggregate to use the SMALL function. The 6 tells it to ignore error values.
IFERROR(INDEX($C$8:$C$12,AGGREGATE(15,6,(ROW($C$8:$C$12)-ROW($C$8)+1)/($F$8:$F$12=$B16),1)) -the 1 tells the function to find the first row with the data that matchs your look up, the 2 in the second formula tells it to find the 2 value that matches your data. You will need to change the ranges to match your data and sheets. The ranges need to start with the first cell that actual holds your data.
 
Upvote 0
Thank you AhoyNC

Sorry, i may have asked the question wrong, how do i find the next new name, i asked for the 2nd in the list
I meant the 2nd or different name

thank you
 
Upvote 0
One way would be to list the names in your summary sheet. You could copy the names from your data sheet and then use the remove duplicates under the data ribbon on your copied data.
Something like below.

Book1
ABCDEFG
7
8Joe Bloggs7718 - Student Castle CambridgeJoe Bloggs
9Test1Sam Jones
10Test2Judy May
117289 - Student Castle LondonJoe Bloggs
12Test4Paul Jones
13Test5Judy May
14
15TotalJN- Site 1LWSR% WageJN- Site 2
16Joe Bloggs7718 - Student Castle Cambridge7289 - Student Castle London
17Sam JonesTest1 
18Judy MayTest2Test5
19Paul JonesTest4 
Sheet1
Cell Formulas
RangeFormula
C16:C19C16=IFERROR(INDEX($C$8:$C$13,AGGREGATE(15,6,(ROW($C$8:$C$13)-ROW($C$8)+1)/($F$8:$F$13=$B16),1)),"")
G16:G19G16=IFERROR(INDEX($C$8:$C$13,AGGREGATE(15,6,(ROW($C$8:$C$13)-ROW($C$8)+1)/($F$8:$F$13=$B16),2)),"")
 
Upvote 0

Forum statistics

Threads
1,214,869
Messages
6,122,015
Members
449,060
Latest member
LinusJE

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