resonance1
resonance1

Reputation: 97

Automatically updating the range for rank function

I want to have a rank function that will automatically update when new data gets pasted into my workbook. The problem is that I have different classes on one sheet and I need to rank items based on the class they belong to.

This picture shows the ranks of each. The formula I used for the rank was =rank(b2,$b2:$b5) and dragged this down. The reference area changes depending on the animal.

I also have a column that counts the number of times 'dog' was used in a row if that helps. So once 'cat' comes up the counter will reset to 1.

The goal is to have the workbook update automatically so I don't have to change the ranges every month.

Upvotes: 0

Views: 396

Answers (2)

QHarr
QHarr

Reputation: 84465

Or

=SUMPRODUCT(($A$2:$A$10=A2)*($B$2:$B$10>B2))+1

Fill down.

Data

source

Upvotes: 0

Scott Craner
Scott Craner

Reputation: 152605

Use COUNTIFS():

=COUNTIFS(A:A,A2,B:B,">=" & B2)

enter image description here

Upvotes: 1

Related Questions