I have a list of number like what follows
1,1,1,5,5,8,8,8,8,10,10
I want to return a rank of 1,1,1,2,2,3,3,3,3,4,4
Not 1,1,1,4,4,6,6,6,6,10,10 like the Rank function does.
How do I do this? Thanks.
Rank
-
- Administrator
- Posts: 78465
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Rank
Let's say your values are in A1:A11.
Enter the following array formula in B1, confirmed with Ctrl+Shift+Enter:
=SUM(--ISNUMBER(MATCH(ROW(INDIRECT("1:"&RANK(A1,A$1:A$11,1))),RANK(A$1:A$11,A$1:A$11,1),0)))
Fill down to B11.
Enter the following array formula in B1, confirmed with Ctrl+Shift+Enter:
=SUM(--ISNUMBER(MATCH(ROW(INDIRECT("1:"&RANK(A1,A$1:A$11,1))),RANK(A$1:A$11,A$1:A$11,1),0)))
Fill down to B11.
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 78465
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Rank
By the way, the above complicated formula will work even if the values haven't been sorted in ascending order.
If they are guaranteed to be in ascending order, you can use a much simpler formula:
In B1, enter the value 1.
In B2, enter the formula =B1+(A2>A1)
Fill down from B2 to B11.
If they are guaranteed to be in ascending order, you can use a much simpler formula:
In B1, enter the value 1.
In B2, enter the formula =B1+(A2>A1)
Fill down from B2 to B11.
Best wishes,
Hans
Hans