Hi,
ın F5 cell = RANK.EQ(C5,$C$5:$C$9,0)+COUNTIF($C$5:C5,C5)-1 then copy down it gives you 1, 2, 3, 4 ,5
my goal is only (1 to 4).
Excel 2013/2016 | ||||
---|---|---|---|---|
C | D | |||
4 | Data | Rank | ||
5 | 92 | 2 | ||
6 | 69 | 3 | ||
7 | 92 | 2 | ||
8 | 96 | 1 | ||
9 | 51 | 4 | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D5 | {=SUM(0+(FREQUENCY(IF($C$5:$C$9>C5,$C$5:$C$9),$C$5:$C$9)>0))+1} | |
Press CTRL+SHIFT+ENTER to enter array formulas. |
Or try
PHP:=SUMPRODUCT(($C$5:$C$9>C5)/COUNTIF($C$5:$C$9,$C$5:$C$9))+1
one more question, what if i try to ascending & descending? what to change?
You would change the ">" symbol for "<".
For my suggestion, you would change the first ">" only.
FWIW, using FREQUENCY() for these unique conditional counts is known to be faster than the countif() alternative - whether you will notice the difference though probably comes down to how big your data set is and how many times you are invoking the formula.
Or try
PHP:=SUMPRODUCT(($C$5:$C$9>C5)/COUNTIF($C$5:$C$9,$C$5:$C$9))+1