Pivot Table Sort in Excel (Table of Content)
- Pivot Table Sort in Excel
- How to Sort Pivot Table Columns in Excel?
- How to Sort Pivot Table Rows in Excel?
Pivot Table Sort in Excel
Pivot tables are an amazing way to analyze your data. According to many experts, the single most powerful data analysis tool available in Excel is the pivot table. Pivot table allows you to organize and condense data that might otherwise contain a large list of values which would take a lot of time to make sense of. So in this topic, we are going to learn about Pivot Table Sort in Excel, Let us see an example.
Suppose you have a large table of employee performance information. You want to know who worked how much and what is the cost savings associated with each employee were. There are multiple ways of doing this. You can start by adding each value you need and put the data manually in a different table. Or you can go the old fashioned way and visually start inspecting each value. Both of these are time-consuming and error-prone activities. Thankfully, excel’s pivot tables simplify this task and gives you a handy tool to separate the data. All you have to do is select the data you want, insert a pivot table at a location other than the original table and you have all values summed and ready to analyze. You can pick and choose what you want to display.
Steps to Create a Pivot Table in Excel
A brief discussion below would familiarize you with how to create Pivot Table in Excel:
Step 1: Select the table you want to get data from.
Step 2: Click on Insert
Step 3: Select Pivot Table and a pop up window will appear.
In this since we have already selected the data, the Select Table or Range option is auto-filled, if you want to change it, it can be done here.
Step 4: Select from where you want the Pivot table to be located, in this case, I am creating a new page but not a new sheet.
Step 5: Specify the exact location of the Pivot Table.
Click Ok and your pivot table is now created.
Step 6: Now that the pivot table is created, specify which data you want to display.
The end result should look like this:
This is a small table I created to illustrate how to create a pivot table. A larger pivot table to practice on is also included with the practice dataset these values have been taken from and will be used for illustrating how to sort data in a pivot table.
Now that we have seen how to create a pivot table, let us get to the main subject of this article, which is sorting data inside a pivot table.
How to Sort Pivot Table Columns in Excel?
For small tables, sorting data is straightforward, you just need to select the Row Label column if you want to sort the data alphabetically and specify whether you want to sort from A-Z or Z-A.
Or you can click on More Sort Options to get detailed settings in the pop-up window that appears on the screen.
As you can see, sorting can be done alphabetically from A-Z or Z-A, by value in ascending or descending order or manually using any order we need for visualizing the data.
For larger tables, perform the following steps:
- Click on Data in the Ribbon Menu on the top of the screen.
- Click on Sort and a pop-up window appears.
- In the pop-up window, we can select any of the attributes we want to sort from the table and sort by value, alphabetical order and many other attributes.
- We can also sort multiple attributes simultaneously by clicking on add level and specifying the next parameter we want to sort on.
The end result of this would give us the data we require. Coming back to our original example, we can now find out who worked how much and how much cost savings were available for each employee. We can also find out various parameters for sets of data by sorting according to our preferences and selecting filters accordingly.
How to Sort Pivot Table Rows in Excel?
We have seen how to arrange pivot table data in various orders inside a column. The following steps illustrate how to sort pivot table data inside a row.
Consider the following table:
Now if we want to directly see the TBD values next to the Analyst Name, we need to sort the data in the rows so that the Cost Savings column is next to the Row Labels column.
To do this, perform the following steps:
- Right click on the cell where you need to start sorting from, a dropdown menu appears:
- Select Sort and then More Sort Options from the next dropdown that appears
- A pop-up window appears, select the order which you want, in this case, the smallest to largest order as we can see from the data:
Select Left to Right instead of Top to Bottom and click OK.
- The end result should look like this:
Now that we have seen examples and also learned how to sort data in Pivot.
4.9 (2,452 ratings)
Things to Remember
- Before sorting any data, make sure that there are no extra spaces leading the values, these leading spaces will affect sort results especially if we are sorting text values or using text parameters such as sorting alphabetically from A-Z or Z-A
- In pivot tables, sorting cannot be done on a case sensitive basis for text, all text is treated as being the same case and no distinction is made between uppercase and lowercase.
- Pivot tables do not allow sorting by a specific format, such as cell color, font color or conditional formatting indicators like sets of icons.
- Sorting in Pivots requires practice and knowledge of the structure of the data you are working with, as the selection of sorting parameters will depend on this.
- While using multiple sort levels, never select the whole table as it will change the structure of the pivot and throwing an error instead of the desired result.
Data analysis using excel is a vast field. Pivot table sort is just one of the many features available for us to sort, analyze and display data.
As we keep learning new concepts, we will keep finding new and exciting ways to manipulate data. I have included a practice workbook along with this article. You are encouraged to add your own data and apply the concepts highlighted in this article. Further resources are also available elsewhere in our website as well on the Microsoft Support site for specific functionalities.
The key to learning and applying these concepts effectively is practicing with the kind of data an actual business would use, not being afraid to make mistakes and having an open mind towards different challenges we might face on our learning journey. It is always a pleasure to teach new concepts and I hope you find our content interesting. Have an enjoyable learning experience.
This has been a guide to Pivot Table Sort in Excel. Here we discussed How to Sort Pivot Table Columns and Rows in Excel along with Examples and downloadable excel template. You may also look at these useful functions in excel –