Google Sheets Sort Pivot Table by Values: Full Guide
In this article
To sort a Google Sheets pivot table by values, open the Pivot table editor, find the Row or Column group you wish to organize, and change the "Sort by" dropdown menu from the label name to the specific value field (e.g., SUM of Revenue). This allows you to instantly rank your data from highest to lowest or vice versa, rather than relying on alphabetical order.
What You'll Need
- A Google account with access to Google Sheets.
- An existing dataset (a range of cells with headers) that you want to analyze.
- An active Pivot Table already created from that dataset.
Step-by-Step
- Open your Google Sheet and navigate to the tab containing your Pivot Table. If the Pivot Table editor is not currently visible on the right side of your screen, click anywhere inside the Pivot Table area to reactivate the side panel.
- Locate the Pivot Table Editor. This panel is divided into four main sections: Rows, Columns, Values, and Filters. To sort by a value, you must actually modify the settings of the Row or Column that you want to be rearranged.
- Identify the Row or Column to sort. For example, if you have a list of "Salespeople" in your Rows and "Total Sales" in your Values, and you want to see who sold the most, you need to look at the "Salespeople" section within the Rows area of the editor.
- Click the "Sort by" dropdown menu. By default, this is usually set to the name of the row label (e.g., "Salesperson"). Click the arrow to reveal a list of available sorting options.
- Select the Value field. In the dropdown list, you will see the names of the labels and the names of the calculated values you have added to the "Values" section of the table. Select the specific calculation you want to sort by, such as "SUM of Total Sales" or "COUNT of Orders."
- Choose the Order. Immediately below the "Sort by" dropdown is the "Order" dropdown. Select "Descending" to put the largest values at the top (best for "Top 10" lists) or "Ascending" to put the smallest values at the top.
- Verify the change. Your pivot table will update automatically. The rows will now be shifted based on the numerical value of the selected field rather than the alphabetical order of the labels.
Common Mistakes
One of the most frequent errors users make is attempting to sort by clicking the header of the value column directly in the spreadsheet grid. In a standard data range, clicking the filter icon in a header allows you to sort the entire sheet. However, in a Pivot Table, this action is often disabled or does not behave as expected because the table is dynamically generated. You must use the Pivot Table Editor panel to change the sorting logic; otherwise, the sort will not persist when the data refreshes.
Another common mistake is trying to sort by a value that has not yet been added to the "Values" section of the editor. Google Sheets only allows you to sort a row by a metric that is actively being calculated and displayed in the table. If you want to sort by "Average Price" but you only have "Sum of Price" in your values, you will not see the average as an option in the sort dropdown.
Users also frequently confuse the "Filter" section with the "Sort" section. Filtering removes data from view based on criteria, while sorting simply changes the order of the data. If your data seems to be missing after you try to organize it, check your Filter settings to ensure you haven't accidentally excluded specific values.
Tips
To make your sorted data even more impactful, combine value-sorting with Conditional Formatting. Once you have sorted your pivot table from highest to lowest, apply a color scale (Format > Conditional formatting > Color scale) to the value column. This creates a visual heat map that emphasizes the gap between your top and bottom performers.
If you are dealing with a very large dataset, consider using a Filter in the Pivot Table editor to show only the "Top X" items. While Google Sheets doesn't have a dedicated "Top 10" button like some other spreadsheet software, you can sort by value (Descending) and then use a filter to exclude the bottom percentages or specific low-value categories, keeping your report clean and focused.
When working with multiple rows (nested rows), remember that sorting is hierarchical. If you have "Region" as your first row and "Salesperson" as your second row, sorting the "Salesperson" row by value will sort the people within each region, but it will not move the regions themselves. To sort the regions based on the total value of all salespeople within them, you must apply the sort settings to the "Region" row in the editor.
Troubleshooting
The "Sort by" dropdown does not show my value field: This usually happens because the value has not been added to the "Values" section of the Pivot Table editor. Ensure that the metric you want to sort by is currently visible in the table. If it is there but not in the dropdown, try refreshing the page or clicking outside the table and back in to reset the editor panel.
The sort is not applying to the whole table: Check if you have multiple rows in your pivot table. As mentioned in the tips section, sorting is applied per level. If you want the entire table to be ordered by a single value, ensure the top-most row in your "Rows" section is the one being sorted by that value. If a higher-level category is sorted alphabetically, the lower-level categories will only be sorted relative to their parent group.
The data is sorted, but the numbers look wrong: Check your "Summarize by" setting in the Values section. If you intended to sort by the total sum but the table is set to "Count," the sort will be based on the number of entries rather than the numerical total. Change "Count" to "Sum" or "Average" as needed, and the sort order will automatically adjust to the new calculation.
The Pivot Table Editor has disappeared: This is a common UI quirk. The editor only appears when a cell inside the pivot table is selected. If you click on a blank cell elsewhere in the sheet, the editor closes. Click any cell within the pivot table boundaries to bring the panel back.
Frequently Asked Questions
Can I sort a pivot table by two different values at once?
No, you cannot sort a single row by two different value columns simultaneously. You can, however, have multiple rows, each sorted by a different value. For example, you can sort "Regions" by "Total Revenue" and then sort "Cities" within those regions by "Growth Percentage."
Does sorting the pivot table change the original source data?
No. A pivot table is a summary layer that sits on top of your data. Any sorting, filtering, or grouping you do within the pivot table editor only affects the presentation of the summary; your original raw data remains untouched and in its original order.
Why can't I just use the "Sort sheet" option from the Data menu?
The "Sort sheet" or "Sort range" options in the Data menu are designed for static cells. Because pivot tables are dynamic and recalculate whenever the source data changes, manual sorts are overridden by the pivot table's internal logic. Using the editor ensures the sort remains active even after data updates.
Can I sort by a calculated field?
Yes. If you have created a calculated field within the pivot table (using the "Add" button in the Values section), that calculated field will appear as an option in the "Sort by" dropdown for your rows and columns.
Will the sort order be maintained if I add new data to the source range?
Yes, as long as the "Sort by" setting is configured in the editor. When new data is added to the source range, the pivot table recalculates the values and automatically re-sorts the rows based on the rules you established in the editor.