Formula for pulling in names based on different fields counted?
I'm seeking health with a couple formulas to pull in employee names when they are nominated for a certain value.
I have columns for: Name, Value, Region. On my metrics sheet, I'd like to capture:
- Name (employee) with the highest vote count per value
- Name (employee) with the highest vote count per region
- Name (employee) with the highest vote count per region per value
I'd also like to pull in the top employee per category, but not sure how to capture this. I have a COUNT column in my source sheet which is just counting the number of times a name (employee) has been voted for, but not sure how to organize this on the metrics sheet dynamically. Is there a way I can pull in the top 5 highest count of employees per value/region/etc?
Thank you in advance for any help you can provide! I am a novice at formulas but am hoping to improve :)
Answers
-
We can use the
INDEX
,MATCH
, andCOLLECT
functions to achieve this—
Name (employee) with the highest vote count per value:
Assuming your data is in a sheet named "SourceSheet" with columns
Name
,Value
,Region
, andCount
.- Create a Helper Column for Maximum Count per Value:
- Add a new column named
Max Count per Value
. - Use the formula:
=MAX(COLLECT(Count:Count, Value:Value, [Value]@row))
- Add a new column named
- Get the Employee Name:
- Add a new column named
Top Employee per Value
. - Use the formula:
=INDEX(Name:Name, MATCH([Max Count per Value]@row, Count:Count, 0))
- Add a new column named
—
Name (employee) with the highest vote count per region:
- Create a Helper Column for Maximum Count per Region:
- Add a new column named
Max Count per Region
. - Use the formula:
=MAX(COLLECT(Count:Count, Region:Region, [Region]@row))
- Add a new column named
- Get the Employee Name:
- Add a new column named
Top Employee per Region
. - Use the formula:
=INDEX(Name:Name, MATCH([Max Count per Region]@row, Count:Count, 0))
- Add a new column named
- —
Name (employee) with the highest vote count per region per value:
Create a Helper Column for Maximum Count per Region and Value:
- Add a new column named
Max Count per Region per Value
. - Use the formula:
=MAX(COLLECT(Count:Count, Region:Region, [Region]@row, Value:Value, [Value]@row))
Get the Employee Name:
- Add a new column named
Top Employee per Region per Value
. - Use the formula:
=INDEX(Name:Name, MATCH([Max Count per Region per Value]@row, Count:Count, 0))
—
Top 5 highest count of employees per value/region/etc:
Create a Rank Column:
- Add a new column named
Rank
. - Use the formula:
=RANK(Count@row, Count:Count)
Filter by Specific Criteria:
- Use a Report to filter and sort data based on
Rank
,Value
,Region
, or other criteria.
Example for Top 5 Employees per Value:
- Create a Report:
- Filter the report by
Value
to get the specific value. - Sort the report by
Count
in descending order. - Display the top 5 rows.
- Filter the report by
Ensure your column names in formulas match exactly with the actual column names in your sheet. Use cell linking or reports to dynamically pull in data from different sheets if needed.
- Create a Helper Column for Maximum Count per Value:
-
@Spoonhead thanks! Could you confirm what your "Count" column is referencing in the above? I'm getting some odd return values.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!