Index match large problem

ebea

Active Member
Joined
Jul 12, 2008
Messages
302
Office Version
  1. 2021
Platform
  1. Windows
Hi! I run into problems, to get get the highest values in a range, listed correctly. The code I use, are originally grabbed from: Index Match Duplicate Values With No Helper Cells [SOLVED]

I have changed the code, delivered from T. Valko (in the Link) a bit, to fit into my use. But when I try to list the highest values, I do only get the value listed as they comes from the match, and not the highest values, as they should be.
I put in here, the example, below!
I only need the 6 highest values.

Do anyone have an idea, how to correct this?
Thank you!

Book1
ABCDEFGHIJKLMNOP
1200200198200200200200200199199198200200200199199
21511151212151016121191110181714
3
4Large 1Large 2Large 3Large 4Large 5large 6
5151112121510<---------Formula result
6
7181615151212<---------Should be
Sheet1
Cell Formulas
RangeFormula
A5:F5A5{=INDEX($A2:$P2,MATCH(LARGE($A1:$P1-COLUMN($A1:$P1)/10^10,COLUMNS($A5:A5)),$A1:$P1-COLUMN($A1:$P1)/10^10,0))}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Maybe

Book1
ABCDEFGHIJKLMNOP
1200200198200200200200200199199198200200200199199
21511151212151016121191110181714
3
4Large 1Large 2Large 3Large 4Large 5large 6
5181615151212
Database
Cell Formulas
RangeFormula
A5:F5A5=AGGREGATE(14,6,$A$2:$P$2/($A$1:$P$1=200),COLUMNS($A5:A5))
 
Upvote 0
Hi Fluff! In my exact (short) example, your solution works perfectly. But then when I copied down of the list, which are on the sheet, it produced errors, which I cannot see how they occur!
I put in an example with some more lines (and also empty columns in the list).

So far, thank you!
Book1
ABCDEFGHIJKLMNOPQRSTUVW
1200200198200200200200200199199198200200200199199
214161515131514181516131516161415181616161515
3196196000000000019819900
48111210#NUM!#NUM!#NUM!#NUM!#NUM!#NUM!
5197199195200196199199199194194199199198199198200
613981710814155613157911111711#NUM!#NUM!#NUM!#NUM!
Sheet1
Cell Formulas
RangeFormula
R2:W2, R6:W6, R4:W4R2{=AGGREGATE(14,6,$A2:$P2/($A1:$P1=200),COLUMNS($R2:R2))}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0
Row 4 is all errors because you don't have 200 anywhere in row 3 & row 5 only has two 200 so you only get 2 answers.
To get rid of the errors you can use
=IFERROR(AGGREGATE(14,6,$A4:$P4/($A3:$P3=200),COLUMNS($R4:R4)),"")
 
Upvote 0
Ah, Fluff! Why did I not catch this ;-) I have to put in a < So the formula became: {=AGGREGATE(14,6,$A2:$P2/($A1:$P1=<200),COLUMNS($R2:R2))}

Thank you Fluff. Problem solved!
 
Upvote 0
Glad you sorted it & thanks for the feedback
 
Upvote 0
..Best as I thought all was okay, I can see, that the solution do not work correctly. As soon, I point only on max value 200, it works when all values are 200. And when I put in to have values below 200, the problem comes, as the list becomes wrong. Try to look at the example below. The index has to return the numbers, related to the highest numbers in the match!

Book1
ABCDEFGHIJKLMNOPQRSTUVWXY
1197199195200196199199199194194199199198199198200200200199199199199
21398171081415561315791111171515141313<------ result
3
4171115151413<----- should be
Sheet1
Cell Formulas
RangeFormula
R2:W2R2{=AGGREGATE(14,6,$A2:$P2/($A1:$P1<=200),COLUMNS($R2:R2))}
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0
Can you please explain, in words, what you are trying to do?
 
Upvote 0
I will try! I want to take max 6 numbers, out of the list which you see in A:P. These 6 numbers, are related to the highest numbers in that list. So if there are 3 with 200, and 3 with 199, it will be 3 of each of these (index) numbers. And so on, downwards in number size.
If you see in the actual example, there are 2 on 200, but they have not the highest (index) numbers. There are numbers 199 which have higher (index) number, than the 200, but they have to become lower in the generated list. I hope it gives more meaning. Else, I try again ;-)
Thank you!
 
Upvote 0
My original formula, actually list the index number correctly, but the problem was, that if there was duplicates in the index numbers, it only list the first of each these duplicate numbers!
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,021
Latest member
pingpong7117

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