Not ranking 0's

D

Darren

I am trying to rank a string of 5 numbers giving each rank a score depending
on their effort. The problem I have is that some efforts have a 0, yet the
rank function still gives them a value of at least 1.

Example

Alpha 5
Bravo 0
Charlie 4
Delta 1
Echo 3

The result would be:
Alpha - rank 1
Charlie - rank 2
Echo - rank 3
Delta - rank 4
Bravo - rank 5

How can I tell the command to, if it sees a 0, award it a 0 ranking?
 
M

Mike H

Darren,

Try this and drag down

=IF(B1=0,0,SUMPRODUCT(1-($B$1:$B$5=0),--(B1 < $B$1:$B$5))+1)

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
C

Chip Pearson

Try

=IF(B1=0,0,RANK(B1,$B$1:$B$10,0))

where B1:B10 is the range of the values to rank.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top