By using a pivot table, you can summarize your data in an understandable manner. And, that summary can help you to analyze data on category wise, product wise, month wise, etc.
One of the common practices for analyzing data is by ranking them. Ranking categories and products can help you to compare them with each other.
The best part about ranking is you can check what is on the top and what is at the bottom. If we use ranking in a pivot table we can save a lot of time and effort and it will help us in our analysis.
So today, in this post, I’d like to show you 3 different methods to add a rank column in a pivot table.
NOTE: Pivot tables are one of the INTERMEDIATE EXCEL SKILLS and ranking in a pivot table is one of the advanced pivot table skills.
Add Pivot Table Rank in Excel 2010 and Above
- Add value field twice in the pivot table for which you want to measure the ranking.
- Select any of the cells from second data column and right click on it.
- Go to “Show Values As”. You have two different options to add ranking “Rank Smallest To Largest” or “Rank Largest To Smallest”, select any one you want to use.
- It will convert the column values into ranks, and after that just sort your data to analyze the ranking.
This is the easiest method to add ranking to a pivot table if you are using Excel 2010 or an earlier version.
Important: While using this method, ranks will change when you filter the pivot table.
Add Pivot Table Rank in Excel 2007 and Below
- First, sort the data in ascending order on which you want to calculate the ranking.
- After that, open the calculated field dialog box and enter “=1” in the formula input bar.
- This will add a new field in your pivot with a value of 1 in all cells.
- Next, select any of the cells in that field and right-click.
- Now, select the “Value Field” option, and in the value field setting dialog box, go to the “Show Values As” tab.
- From the drop-down list, select “Running Total In” and click OK.
- Now, you have a column with rankings in your pivot table.
Alert: Make sure that you have sorted your pivot table in ascending or descending order.
Using RANK.EQ and RANK.AVG in Source Data
This method is a little bit tricky, but it works like a charm. The benefit of using RANK.EQ and RANK.AVG is that you don’t have to add anything to your pivot table. Just follow these simple steps.
- First of all, in your raw data insert a new column and add this formula into the formula bar:
- (Here’s how the formula works: This formula will add a single total for each category in the column. And, you can use that total to calculate the rank for each category).
- Now, add two more columns at the end of your data and add the below formulas in them.
- (Here’s how the formula works: RANK.EQ & RANK.AVG will calculate the ranking for the category in your data dump. We have used both of these functions to get different ranking types).
- After that, create a pivot table using this data dump, just like below. You can use any of both columns to calculate the ranking.
Important: While using this method, ranking will not change when you filter the items.
Add a Separate Rank Column in a Pivot Table
Instead of using formulas or any other method you can also add a manual separate column for ranking. When you want to add ranks for an instance, you can use this method. Just follow these simple steps.
- Take a pivot table and sort the values in ascending or descending order as you like.
- And, in the next two columns outside the pivot table add the below formulas.
- Drag them below and you have the ranking along with the pivot table.