Identify top 10 largest (unique) values in a table

DonEB

Board Regular
Joined
Apr 26, 2016
Messages
128
Office Version
  1. 2019
Platform
  1. Windows
I have a table that spans the following range: CE30:CT45

This table will consist of many blanks but will mostly contain values ranging from 0 to 1. Yes, most of the values will be in decimal form (i.e., 0.25, .3333, 0.5, 0.6667, etc.) and yes... there will likely be many duplicates.

I need to come up with a list of unique values.

In column CC, starting in row 47 and going down, I've attempted to use =LARGE($CE$30:$CT$45,1), =LARGE($CE$30:$CT$45,2), =LARGE($CE$30:$CT$45,3), etc. to identify these values but realize that it will require inputting this formula into 320 cells to simply get me part way to where I need to go.

So, I have two questions:
  1. Before I go to far with my original thought, I was wonder if there is something much more compact and efficient that someone could share that would help me achieve my goal.
  2. If my initial thought was the best or only way to go then my next question would be... how do I examine the list of 320 cells (CC47:cc366) to come up with my unique list of numbers?

Thanks for any assistance that can be provided.

Don
 

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.
.
Here is one way :




A
B
C
D
E
F
G
H
I
J
1
1​
6​
88​
10​
1st
99​
<-- =LARGE(A1:D10,1)
2
55​
4​
35​
45​
2nd
88​
<-- =LARGE(A1:D10,2)
3
23​
12​
64​
22​
3rd
82​
etc
4
42​
82​
27​
34​
4th
72​
etc
5
6​
32​
24​
38​
5th
65​
6
58​
15​
99​
52​
6th
64​
7
12​
14​
36​
13​
7th
58​
8
32​
65​
41​
15​
8th
55​
9
28​
43​
43​
18​
9th
52​
10
39​
72​
21​
19​
10th
45​
 
Last edited:
Upvote 0
@DonEB

In CC47 just enter:

=MIN(10,SUM(IF(FREQUENCY(CE30:CT45,CE30:CT45),1)))

In CC48 just enter: u-list

In CC49 control+shift+enter, not just enter, and copy down:

=IF(ROWS($CC$49:CC49)>$CC$47,"",MIN(IF(ISNA(MATCH($CE$30:$CT$45,$CC$48:CC48,0)),IF(ISNUMBER($CE$30:$CT$45),$CE$30:$CT$45))))
 
Upvote 0
Thank you Aladin. This works perfectly. Gave your solution a "Thumbs Up". If there is another way for me to indicate "problem solved", please let me know.
 
Last edited:
Upvote 0
@DonEB

In CC47 just enter:

=MIN(10,SUM(IF(FREQUENCY(CE30:CT45,CE30:CT45),1)))

In CC48 just enter: u-list

In CC49 control+shift+enter, not just enter, and copy down:

=IF(ROWS($CC$49:CC49)>$CC$47,"",MIN(IF(ISNA(MATCH($CE$30:$CT$45,$CC$48:CC48,0)),IF(ISNUMBER($CE$30:$CT$45),$CE$30:$CT$45))))


Aladin... almost two years ago you provided me with the code above. It has worked perfectly. Recently, I tried to duplicate that in a new spreadsheet but failed. Let me explain how.

First, here is the code I used:
In cell C40, I entered the following code: =MIN(10,SUM(IF(FREQUENCY(E5:X24,E5:X24),1)))
Then I highlighted C42:C51 and entered =IF(ROWS($C$42:C42)>$C$40,"",MIN(IF(ISNA(MATCH($E$5:$X$24,$C$41:C41,0)),IF(ISNUMBER($E$5:$X$24),$E$5:$X$24))))

I then proceeded to hold Control+shift and hit enter. Cell C40 contained the number 3 indicating there were only 3 unique values thus far... which was true. I then expected C42 to contain a 0, C43 to contain a 0.5 and C44 to contain a 1 but they were all zero's and then blank after that.

I can see that it turned into an array because it has the {} around each of the formula's within each of the 10 cells ranging from C42:C51.
But the cell references within the formula which were NOT absolute did not incrementally increase as I went down each cell to examine the formulas.

I'm a little perplexed as to what I may have done wrong. Any suggestions?
 
Upvote 0
In C42 control+shift+enter:

=IF(ROWS($C$42:C42)>$C$40,"",MIN(IF(ISNA(MATCH($E$5:$X$24,$C$41:C41,0)),IF(ISNUMBER($E$5:$X$24),$E$5:$X$24))))

then copy down.

Note that the formula is meant to pick out distinct numbers from E5:X24, that is, it expects numeric input in E5:X24.
 
Upvote 0

Forum statistics

Threads
1,215,047
Messages
6,122,858
Members
449,096
Latest member
Erald

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