Excel Matching Function for distinct values related to particular rows/columns.

AbsentStream

New Member
Joined
Jan 21, 2019
Messages
6
Hi Guys

Having a problem with the Index matching function on excel.

I'm using a SMALL IF function to pull the smallest 10 figures from one sheet to another and then using index matching to take these figures and pull a particular code associated to that figure from the sheet (The code and the figure are in the same row in the sheet FYI). This works for where we have values which don't have duplicates in the sheet fine. The problem that's popping up is that some values are the same but have different codes and I don't know how to distinguish which code Is the one we're looking at for that particular figure using an excel function.

For example, '0' is a figure which pops up a lot but the index matching function I'm using only returns one code for all '0' values from the sheet, rather than the one associated with that code.

Is there a way of making the index function or the small if function pull in the row/column to which it is pulling that figure from so we can match it to a code? Or is there a better way to go about this?

Appreciate Any Detailed Help With This,

Absent.
 
If your happy to change the layout, you could use


Excel 2013/2016
ABCDEFGHIJKLMNO
1NameCodeNumberNAMENUMBERCODE
2JOHNAB-10JOHN-10ABPAT-8QRTOM-2BLUE
3JOHNCD-2JOHN-6KLPAT-6ABCTOM0RED
4JOHNEF0JOHN-2CDPAT-2STTOM4YELLOW
5JOHNGH0JOHN0GHPAT0WXTOM6PURPLE
6JOHNIJ2JOHN0EFPAT0UVTOM11GREEN
7JOHNKL-6
8JOHNMN8
9JOHNOP10
10PATQR-8
11PATST-2
12PATUV0
13PATWX0
14PATYZ3
15PATABC-6
16PATDEF8
17PATGHI8
18PATJKL11
19PATMNO12
20PATPQR14
21TOMBLUE-2
22TOMRED0
23TOMYELLOW4
24TOMPURPLE6
25TOMBLACK12
26TOMGREEN11
27TOM2WHITE-8
28TOM2SILVER-4
29TOM2GOLD0
30TOM2GREY4
Sheet2
Cell Formulas
RangeFormula
G2=INDEX($B$2:$B$30,AGGREGATE(14,6,(ROW($B$2:$B$30)-ROW($B$2)+1)/($A$2:$A$30=E2)*($C$2:$C$30=F2),COUNTIF($F$2:F2,F2)))
K2=INDEX($B$2:$B$30,AGGREGATE(14,6,(ROW($B$2:$B$30)-ROW($B$2)+1)/($A$2:$A$30=I2)*($C$2:$C$30=J2),COUNTIF($J$2:J2,J2)))
O2=INDEX($B$2:$B$30,AGGREGATE(14,6,(ROW($B$2:$B$30)-ROW($B$2)+1)/($A$2:$A$30=M2)*($C$2:$C$30=N2),COUNTIF($F$2:N2,N2)))
F2{=SMALL(IF($A$2:$A$30=E2,$C$2:$C$30),ROWS($1:1))}
J2{=SMALL(IF($A$2:$A$30=I2,$C$2:$C$30),ROWS($1:1))}
N2{=SMALL(IF($A$2:$A$30=M2,$C$2:$C$30),ROWS($1:1))}
Press CTRL+SHIFT+ENTER to enter array formulas.


Although I cannot manage the TOM or TOM2
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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