Index/Match/Large Function - multiples of the same number affecting results

Jzfbkr

New Member
Joined
Aug 4, 2014
Messages
29
i'm using the following function:

=INDEX(A432:A437,MATCH(LARGE(B432:B437,1),B432:B437,0)))

on the below data set

ab
432Item listFrequency
433Soup1
434Chocolate2
435Bananas3
436Crisps3
437Steak4

<tbody>
</tbody>

<tbody>
</tbody>
I want to return the Item based on the Largest, 2nd Largest, 3rd Largest result, 4th Largest result & 5th Largest result.

But with duplicate frequencies e.g 3

The item will only return as the top listed 'Bananas'

How can I solve this?

Thanks
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
For simplicity, let's assume that A2:B10 contains the data. Try the following...

D2: 5

(Enter 5 in cell D2, which indicates that you want a Top 5 list. This can be changed as desired. So, for example, if you enter 3 instead, you'll get a Top 3 list.)

E2:

=COUNTIF(B2:B10,">="&LARGE(B2:B10,D2))

F2, copied down:

=IF(ROWS(F$2:F2)<=$E$2,LARGE($B$2:$B$10,ROWS(F$2:F2)),"")

G2, confirmed with CONTROL+SHIFT+ENTER, and copied down:

=IF(N(F2),INDEX($A$2:$A$10,SMALL(IF($B$2:$B$10=F2,ROW($A$2:$A$10)-ROW($A$2)+1),COUNTIF($F$2:F2,F2))),"")

Adjust the ranges, accordingly.

Hope this helps!
 
Upvote 0
Fantastic!! Thanks for your help saved me alot of time.

Really well explained.

Thanks again Domenic

I dont suppose there is a way to have a secondary layer? If not no problem you've already helped enough
 
Last edited:
Upvote 0
For simplicity, let's assume that A2:B10 contains the data. Try the following...

D2: 5

(Enter 5 in cell D2, which indicates that you want a Top 5 list. This can be changed as desired. So, for example, if you enter 3 instead, you'll get a Top 3 list.)

E2:

=COUNTIF(B2:B10,">="&LARGE(B2:B10,D2))

F2, copied down:

=IF(ROWS(F$2:F2)<=$E$2,LARGE($B$2:$B$10,ROWS(F$2:F2)),"")

G2, confirmed with CONTROL+SHIFT+ENTER, and copied down:

=IF(N(F2),INDEX($A$2:$A$10,SMALL(IF($B$2:$B$10=F2,ROW($A$2:$A$10)-ROW($A$2)+1),COUNTIF($F$2:F2,F2))),"")

Adjust the ranges, accordingly.

Hope this helps!
I've implemented this into a recent spreadsheet which sometimes returns results of 0. Using the example above if say chocolate had a frequency of 0 my results would not show chocolate at all. Is there a way to change that so it shows chocolate with a frequency of 0?
 
Upvote 0

Forum statistics

Threads
1,216,512
Messages
6,131,091
Members
449,618
Latest member
lewismillar

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