Solved

Finding the nth smallest number in a range, discounting duplicates

Posted on 2011-10-19
Medium Priority
354 Views
I used to know how to do this I think, but I can't find it anywhere. I need something as simple as possible that when I drag it down, each succeeding row gives me the next smallest unique number in the range [PercentsAll].

In other words if the lowest number is 92.53%, and there are 3 such occurrences, I can't have "=SMALL(PercentsAll,ROW(A2))" return 92.53%. I need it to return the next lowest unique number 93.15%

The method I used to know involved a fairly complicated formula, so I'm hoping there's a simpler one out there.

Thanks!

John
``````=SMALL(PercentsAll,ROW(A1))
=SMALL(PercentsAll,ROW(A2))
=SMALL(PercentsAll,ROW(A3))
``````
0
Question by:gabrielPennyback
• 3
• 2

LVL 50

Expert Comment

ID: 36996398
Try using this formula in the first cell, e.g. in C2

=MIN(PercentsAll)

Then in C3 use this array formula confirmed with CTRL+SHIFT+ENTER and copied down

=MIN(IF(PercentsAll>C3,PercentsAll))

regards, barry
0

LVL 50

Accepted Solution

barry houdini earned 2000 total points
ID: 36996434
Sorry, the formula for C3 should refer to the cell above, C2, not C3, like this

=MIN(IF(PercentsAll>C3,PercentsAll))

See attached

regards, barry
27405556.xls
0

LVL 11

Expert Comment

ID: 36996452
If this is a manual process I would

Take the numbers your interested in an filter the list by unique records.

Then I would just sort it ascending or decending.

If you need a complex formula to do it, just let me know.
0

LVL 11

Expert Comment

ID: 36996465
You would filter the list by unique records by selecting data, then in the filter section advanced, then check the unique records box.
0

LVL 50

Expert Comment

ID: 36996490
An improvement to my suggestion...

Use this formula for a count of the different values

=SUMPRODUCT((A2:A50<>"")/COUNTIF(A2:A50,A2:A50&""))

then the formula to list the unique values from smallest to largest can be amended so that it can be copied down further than you need, extra cells will be blank - revised formula in D3 copied down

=IF(C\$2>ROWS(D\$3:D3),MIN(IF(PercentsAll>D2,PercentsAll)),"")

regards, barry
27405556v2.xls
0

LVL 1

Author Closing Comment

ID: 36996817
This is perfect, thanks, Barry. And I love how simple it is. :-)

- John
0

Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Microsoft's Excel has many features that most people will never need nor take advantage of.  Conditional formatting is one feature that you may find a necessity once you start using it.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.
Suggested Courses
Course of the Month13 days, 18 hours left to enroll