Help with ranking based on criteria (RANKEQ, COLLECT)
Hello,
I am trying to rank location names by the number of activities they've accomplished within their specific region.
Dummy data:
When I searched the forum, I found a few examples of RANKEQ with COLLECT. However, I receive errors when I insert this:
=RANKEQ([Total Activities]@row, COLLECT([Total Activities]:[Total Activities], Region:Region, "Gulf Coast", 0))
Can you point me in the right direction? Thank you!
Best Answer
-
You're very close! It looks like you just have one of the closing parentheses in the wrong place.
This is the structure:
=RANKEQ(number to rank, range with numbers, order of rank)
We're replacing the middle range portion with a COLLECT function to filter the range, like so:
=RANKEQ(number to rank, COLLECT(...), order of rank)
Which spelled out becomes:
=RANKEQ(number to rank, COLLECT(range with numbers, criteria, "criteria"), order of rank)
In your formula, we're missing the closing ) for the Collect function, before moving on to the order. Now, the "Criteria" in the Collect function can be manually typed in, like you have, OR we could reference a cell, which is what I would suggest.
Try:
=RANKEQ([Total Activities]@row, COLLECT([Total Activities]:[Total Activities], Region:Region, Region@row), 0)
Cheers,
Genevieve
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
Answers
-
You're very close! It looks like you just have one of the closing parentheses in the wrong place.
This is the structure:
=RANKEQ(number to rank, range with numbers, order of rank)
We're replacing the middle range portion with a COLLECT function to filter the range, like so:
=RANKEQ(number to rank, COLLECT(...), order of rank)
Which spelled out becomes:
=RANKEQ(number to rank, COLLECT(range with numbers, criteria, "criteria"), order of rank)
In your formula, we're missing the closing ) for the Collect function, before moving on to the order. Now, the "Criteria" in the Collect function can be manually typed in, like you have, OR we could reference a cell, which is what I would suggest.
Try:
=RANKEQ([Total Activities]@row, COLLECT([Total Activities]:[Total Activities], Region:Region, Region@row), 0)
Cheers,
Genevieve
Need more information? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao!👋 | Global Discussions
-
Thank you, thank you!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.8K Get Help
- 474 Global Discussions
- 205 Use Cases
- 516 Announcements
- 5.5K Ideas & Feature Requests
- 87 Brandfolder
- 157 Just for fun
- 83 Community Job Board
- 521 Show & Tell
- 36 Member Spotlight
- 3 SmartStories
- 309 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!