Eliminate duplicate values for 2nd and 3rd highest value

gtd526

Well-known Member
Joined
Jul 30, 2013
Messages
720
Office Version
  1. 2019
Platform
  1. Windows
Hello,
I'm using MAX for the maximum value in a range using the following formula (array) using a Named Range (NBA_Best_Percent), which is working correctly:
Excel Formula:
=OFFSET(INDIRECT(INDEX(NBA_Best_Percent,MATCH(MAX(N(INDIRECT(NBA_Best_Percent))),N(INDIRECT(NBA_Best_Percent)),0))),-4,-2)

If there are duplicate values in the Range for 2nd and 3rd highest values it will repeat, showing the same value for both 2nd and 3rd highest values.
I'm using this formula for 2nd and 3rd highest (A44 & A47):
Excel Formula:
=AGGREGATE(14,6,$M$43:$AH$79/(MOD(ROW($M$43:$AH$79)-ROW(M43),12)=0)/(MOD(COLUMN($M$43:$AH$79)-COLUMN(M43),3)=0),2)
Excel Formula:
=AGGREGATE(14,6,$M$43:$AH$79/(MOD(ROW($M$43:$AH$79)-ROW(M43),12)=0)/(MOD(COLUMN($M$43:$AH$79)-COLUMN(M43),3)=0),3)

How can I eliminate duplicate values and go to the next highest value, re: 2nd and 3rd highest value?
Here is the current results:
Cell Formulas
RangeFormula
A40A40=OFFSET(INDIRECT(INDEX(NBA_Best_Percent,MATCH(MAX(N(INDIRECT(NBA_Best_Percent))),N(INDIRECT(NBA_Best_Percent)),0))),-4,-2)
C40,C46,C43C40=ADDRESS(AGGREGATE(15,6,ROW($K$39:$AG$99)/($K$39:$AG$99=A40),1),AGGREGATE(15,6,COLUMN($K$39:$AG$99)/($K$39:$AG$99=A40),1))
A41A41=INDIRECT(INDEX(NBA_Best_Percent,MATCH(MAX(N(INDIRECT(NBA_Best_Percent))),N(INDIRECT(NBA_Best_Percent)),0)))
A43A43=OFFSET(INDIRECT(ADDRESS(AGGREGATE(15,6,ROW($M$43:$AH$80)/($M$43:$AH$80=$A$44),1),AGGREGATE(15,6,COLUMN($M$43:$AH$80)/($M$43:$AH$80=$A$44),1))),-4,-2)
A44A44=AGGREGATE(14,6,$M$43:$AH$79/(MOD(ROW($M$43:$AH$79)-ROW(M43),12)=0)/(MOD(COLUMN($M$43:$AH$79)-COLUMN(M43),3)=0),2)
A46A46=OFFSET(INDIRECT(ADDRESS(AGGREGATE(15,6,ROW($M$43:$AH$80)/($M$43:$AH$80=$A$47),1),AGGREGATE(15,6,COLUMN($M$43:$AH$80)/($M$43:$AH$80=$A$47),1))),-4,-2)
A47A47=AGGREGATE(14,6,$M$43:$AH$79/(MOD(ROW($M$43:$AH$79)-ROW(M43),12)=0)/(MOD(COLUMN($M$43:$AH$79)-COLUMN(M43),3)=0),3)
Press CTRL+SHIFT+ENTER to enter array formulas.


Its a large Range: $M$43:$AH$79
Thank you
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hey,

Formula for 2nd and 3rd highest (A44 & A47) could be,

AGGREGATE(14,6,1/(COUNTIF($M$43:$AH$79,$M$43:$AH$79)=1)*($M$43:$AH$79)/(MOD(ROW($M$43:$AH$79)-ROW(M43),12)=0)/(MOD(COLUMN($M$43:$AH$79)-COLUMN(M43),3)=0)),2)


Please check
 
Upvote 0
Hey,

Formula for 2nd and 3rd highest (A44 & A47) could be,

AGGREGATE(14,6,1/(COUNTIF($M$43:$AH$79,$M$43:$AH$79)=1)*($M$43:$AH$79)/(MOD(ROW($M$43:$AH$79)-ROW(M43),12)=0)/(MOD(COLUMN($M$43:$AH$79)-COLUMN(M43),3)=0)),2)


Please check
If I plug your formula to 2nd & 3rd highest, it skips the 2nd highest and shows the 3rd highest. And 2nd & 3rd are the same (3rd highest).
I had to remove one ")" from the end, else error.
Here are the results:
NBA.xlsm
I
4263.8%
4360.3%
4460.3%
Favs
Cell Formulas
RangeFormula
I42I42=INDIRECT(INDEX(NBA_Best_Percent,MATCH(MAX(N(INDIRECT(NBA_Best_Percent))),N(INDIRECT(NBA_Best_Percent)),0)))
I43I43=AGGREGATE(14,6,1/(COUNTIF($M$43:$AH$79,$M$43:$AH$79)=1)*($M$43:$AH$79)/(MOD(ROW($M$43:$AH$79)-ROW(M43),12)=0)/(MOD(COLUMN($M$43:$AH$79)-COLUMN(M43),3)=0),2)
I44I44=AGGREGATE(14,6,1/(COUNTIF($M$43:$AH$79,$M$43:$AH$79)=1)*($M$43:$AH$79)/(MOD(ROW($M$43:$AH$79)-ROW(M43),12)=0)/(MOD(COLUMN($M$43:$AH$79)-COLUMN(M43),3)=0),2)
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Hey,

Formula for 2nd and 3rd highest (A44 & A47) could be,

AGGREGATE(14,6,1/(COUNTIF($M$43:$AH$79,$M$43:$AH$79)=1)*($M$43:$AH$79)/(MOD(ROW($M$43:$AH$79)-ROW(M43),12)=0)/(MOD(COLUMN($M$43:$AH$79)-COLUMN(M43),3)=0)),2)


Please check
I added your formula only to the 3rd highest, and its not repeating or skipping but showing the 3rd highest. 59.1% would normally repeat ie 2nd and 3rd.
NBA.xlsm
I
4261.7%
4359.1%
4458.7%
Favs
Cell Formulas
RangeFormula
I42I42=INDIRECT(INDEX(NBA_Best_Percent,MATCH(MAX(N(INDIRECT(NBA_Best_Percent))),N(INDIRECT(NBA_Best_Percent)),0)))
I43I43=AGGREGATE(14,6,$M$43:$AH$79/(MOD(ROW($M$43:$AH$79)-ROW(M43),12)=0)/(MOD(COLUMN($M$43:$AH$79)-COLUMN(M43),3)=0),2)
I44I44=AGGREGATE(14,6,1/(COUNTIF($M$43:$AH$79,$M$43:$AH$79)=1)*($M$43:$AH$79)/(MOD(ROW($M$43:$AH$79)-ROW(M43),12)=0)/(MOD(COLUMN($M$43:$AH$79)-COLUMN(M43),3)=0),2)
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,226,479
Messages
6,191,246
Members
453,649
Latest member
jtc19

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