Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 199
Default Help with the rank function

I have a column of figures obtained by using the rank function. However, as
usual, they contain duplicates where appropriate eg 3 ones, followed by a
four etc.

I want to convert the list into a unique set of numbers without any
duplicates - and it doesn't matter which order the 3 ones are in but they
need to change to 1, 2, 3 etc

Can anyone please suggest a way of doing this.

TIA

V

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Help with the rank function

Assume your list is in A2:10. Formula in B2 then is:

=RANK(A2,$A$2:$A$10)+COUNTIF(A3:$A$11,A2)

Copy down as needed.
Adjust references and range size as needed, but note that the COUNTIF
function is offset 1 row.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Victor Delta" wrote:

I have a column of figures obtained by using the rank function. However, as
usual, they contain duplicates where appropriate eg 3 ones, followed by a
four etc.

I want to convert the list into a unique set of numbers without any
duplicates - and it doesn't matter which order the 3 ones are in but they
need to change to 1, 2, 3 etc

Can anyone please suggest a way of doing this.

TIA

V


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Help with the rank function

Hi,

I don't understand, for this set of data what do you expect to see as an
answer?

1
2
3
3
3
4
5
5
6

Mike


I have a column of figures obtained by using the rank function. However, as
u4sual, they contain duplicates where appropriate eg 3 ones, followed by a
four etc.

I want to convert the list into a unique set of numbers without any
duplicates - and it doesn't matter which order the 3 ones are in but they
need to change to 1, 2, 3 etc

Can anyone please suggest a way of doing this.

TIA

V


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Help with the rank function

Assuming your numbers are in A1:A10, put this in B1:

=RANK(A1,A$1:A$10)+COUNTIF(A$1:A1,A1)-1

and copy down. Adjust the A$10 term if you have more numbers.

Hope this helps.

Pete


On Apr 6, 6:50*pm, "Victor Delta" wrote:
I have a column of figures obtained by using the rank function. However, as
usual, they contain duplicates where appropriate eg 3 ones, followed by a
four etc.

I want to convert the list into a unique set of numbers without any
duplicates - and it doesn't matter which order the 3 ones are in but they
need to change to 1, 2, 3 etc

Can anyone please suggest a way of doing this.

TIA

V


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default Help with the rank function

Hello,

A general solution which works for numbers as well as for texts:
http://www.sulprobil.com/html/sorting.html

Regards,
Bernd


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 199
Default Help with the rank function

"Bernd P" wrote in message
...
Hello,

A general solution which works for numbers as well as for texts:
http://www.sulprobil.com/html/sorting.html

Regards,
Bernd


Many thanks to all for the suggested solutions.

V

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Help with the rank function

You can also add a small random number to each value -- "Your Number" +
(Rand() /100000). As long as the denominator is large enough it should have
no material effect on your data and ensure that each number is unique.

"Victor Delta" wrote:

I have a column of figures obtained by using the rank function. However, as
usual, they contain duplicates where appropriate eg 3 ones, followed by a
four etc.

I want to convert the list into a unique set of numbers without any
duplicates - and it doesn't matter which order the 3 ones are in but they
need to change to 1, 2, 3 etc

Can anyone please suggest a way of doing this.

TIA

V


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 806
Default Help with the rank function

Hello,

RAND() does NOT guarantee non-repeating values. The likelihood is low
but greater zero...

Regards,
Bernd
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Help with the rank function

100,000 may be too large a denominator for RANK to distinguish values, so you
might try 5,000 or 10,000 depending on your data - but you can figure that
out. Bernd's comment that RAND() does not guarantee uniqueness is correct,
of course, but 1) the likelihood of a problem is small and 2) you can include
a sum of your numbers and rerun if it's wrong. For example, with 100 numbers
the total of the ranked numbers should be 1 + 2 + 3 + ... + 100 = (N) (N +
1) / 2 = 5050. So if your total is not what it should be - hit "F9" to
recalc and try again.

"Victor Delta" wrote:

"dhstein" wrote in message
...
You can also add a small random number to each value -- "Your Number"
+
(Rand() /100000). As long as the denominator is large enough it should
have
no material effect on your data and ensure that each number is unique.


That's a clever idea. Thanks, I'll use it!

V


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
RANK function Dave F[_2_] Excel Discussion (Misc queries) 4 October 26th 07 10:54 PM
Rank function yshridhar Excel Worksheet Functions 9 August 27th 07 09:10 AM
Rank Function azlan Setting up and Configuration of Excel 1 July 10th 07 09:14 AM
Rank Function Jeff Excel Discussion (Misc queries) 1 November 8th 05 08:26 PM
Need help with RANK function butters14 Excel Worksheet Functions 2 June 21st 05 01:44 PM


All times are GMT +1. The time now is 12:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"