Index & match

raymondboze

New Member
Joined
Jan 27, 2018
Messages
1
Trying to do an Index and Match looking for one particular criteria in multiple ranges of cells and display the value of the matched cell elsewhere in a workbook. For example: I want the value in the second column where it is matched to the value of the cell in the third column to display on a second worksheet.
T4566A31T4854A11
T4564A21T4853A41
T4566T4856

<tbody>
</tbody>
I have figured out that part but what I can't figure out is how to get it to do the same thing if say for example the "A31" in the third column was where the "A41" is in the sixth column. Basically I need it to do this for a total of 9 columns and wherever it finds "A31" at i need the value in the cell to the left of it to display elsewhere. Can anyone help me with this?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Try the following...


A2:J10


T456100A31T4854A11A315100
T4564A21T485400A31400
T4566T4856200
T456200A31T4854A11300
T4564A21T4853A41500
T4566T4856
T456300A31T485500A31
T4564A21T4853A41
T4566T4856

<tbody>
</tbody>


Code:
H2: A31


Code:
I2: =COUNTIF(C2:F10,H2)


Code:
J2, confirmed with CONTROL+SHIFT+ENTER, and copied down:


=IF(ROWS(J$2:J2)<=$I$2,OFFSET(INDIRECT(TEXT(SMALL(IF($C$2:$F$10=$H$2,(ROW($C$2:$F$10)*10^5)+COLUMN($C$2:$F$10)),ROWS(J$2:J2)),"R0C00000"),0),0,-1),"")


Actually, we can avoid using the volatile functions OFFSET and INDIRECT...


Code:
J2, confirmed with CONTROL+SHIFT+ENTER, and copied down:


=IF(ROWS(J$2:J2)<=$I$2,INDEX($A:$F,INT(SMALL(IF($C$2:$F$10=$H$2,(ROW($C$2:$F$10)*10^5)+COLUMN($C$2:$F$10)),ROWS(J$2:J2))/10^5),MOD(SMALL(IF($C$2:$F$10=$H$2,(ROW($C$2:$F$10)*10^5)+COLUMN($C$2:$F$10)),ROWS(J$2:J2)),10^5)-1),"")


Hope this helps!
 
Last edited:
Upvote 0
Or (using data sample provided by Domenic in post 2)

Formula in J2 copied down
=IF($I$2>=ROWS(J$2:J2),AGGREGATE(15,6,B$2:E$10/($C$2:$F$10=$H$2),ROWS(J$2:J2)),"")

M.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,917
Messages
6,122,233
Members
449,075
Latest member
staticfluids

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