Excel: How to Rank Uniquely

Normally rank function in Excel gives you the same rank for duplicate values in a selected range. So if a value appears twice and the first value takes the rank of 1, the next value will also take the rank of 1 and the next rank which is the rank of 2 will be skipped. Then how to rank these values uniquely?

=RANK(A2;$A$2:$A$16;0)+COUNTIF($A$2:A2;A2)-1

Edit: There is another option, though. Even more, the bulletproof one:

=COUNTIF($A$2:$A$16;">"&A2)+COUNTIF($A$2:A2;A2)

(to sort ascending, switch the “>” with “<“).