How to Sort a Pivot Table in Google Sheets
Pivot tables turn messy data sets into clean, digestible summaries, but their real power is unlocked when you start sorting. Learning to properly sort a pivot table in Google Sheets helps you instantly identify top performers, spot trends, and find the exact insights you need without any manual guesswork. This guide will walk you through exactly how to sort by row labels, column labels, and values so you can analyze your data more effectively.
Why Sorting Your Pivot Table is a Game-Changer
Imagine you have a spreadsheet with thousands of rows of sales data, including product names, regions, sales reps, and revenue. A pivot table can summarize this data, showing you total revenue by region. But without sorting, you'll see the regions listed alphabetically: Africa, Asia, Europe, North America.
That’s okay, but it doesn't tell a story. By sorting this pivot table by total revenue in descending order, you instantly see your top-performing region. Is it North America? Europe? This simple action transforms your raw summary into a strategic insight. Sorting allows you to immediately answer questions like:
- Which marketing channel brought in the most leads?
- Who are my top 5 sales reps by revenue?
- Which products are my worst sellers this quarter?
- Which day of the week has the highest website traffic?
Sorting turns your pivot table from a static report into a dynamic analysis tool, turning walls of numbers into a clear narrative about what's working and what isn't.
First, A Quick Refresher: Creating a Basic Pivot Table
Before you can sort anything, you need a pivot table. If you already have one, feel free to skip to the next section. If not, here’s a quick setup using a simple sales data example.
Let's assume your data has columns for Month, Region, Product Category, and Revenue.
- Click anywhere inside your data range.
- Go to the main menu and select Insert > Pivot table.
- In the "Create pivot table" dialog box, ensure the data range is correct and choose to insert it into a new or existing sheet. Click Create.
- The Pivot table editor will appear on the right. Let's build a basic report:
You now have a simple pivot table showing the total revenue for each product category. By default, the product categories will be listed alphabetically. Now, let's sort it.
How to Sort by Row Labels (A-Z or Z-A)
The most common sorting requirement is organizing your row labels. This is useful for arranging text-based categories, like product names or sales regions, into alphabetical or reverse-alphabetical order.
Using our example pivot table, the "Product Category" rows are likely already sorted A-Z by default.
Step-by-Step Instructions:
- In the Pivot table editor on the right side of your screen, find the Rows section.
- You'll see the field you added, "Product Category". Directly below it are options for Sort by and Order.
- In the Sort by dropdown, make sure "Product Category" is selected.
- In the Order dropdown, choose one of the following:
Your pivot table will instantly reorder itself. This is great for finding items alphabetically, but the real magic happens when you sort by your numbers.
How to Sort by Values (e.g., Highest to Lowest Revenue)
This is often the most valuable way to sort a pivot table. Instead of sorting the labels alphabetically, you sort them based on their corresponding value. This is how you find your top-performing products, most profitable regions, or least-effective ad campaigns.
Let's continue with our example pivot table which shows Product Categories and their total SUM of Revenue.
Step-by-Step Instructions:
- Go back to the Pivot table editor and look under the Rows section where your "Product Category" is.
- Click the Sort by dropdown menu. Instead of selecting "Product Category," select SUM of Revenue (or whatever value field you are using).
- Now, click the Order dropdown right next to it.
Just like that, your entire table is reorganized to highlight performance. The category generating the most revenue is now at the top of your list, giving you an immediate and powerful insight into your business.
How to Sort by Column Labels
Sorting by column labels works in the exact same way as sorting by row labels, just in a different section of the editor. This is less common but can be useful if you're analyzing data across time periods, like months or quarters, and want to see them in reverse chronological order.
Let's modify our pivot table:
- Keep Product Category in the Rows section.
- Add Month to the Columns section.
- Keep SUM of Revenue in the Values section.
Your pivot table now displays product categories down the side and months across the top.
Step-by-Step Instructions:
- In the Pivot table editor, look for the Columns section.
- Under your "Month" field, you'll see the same Sort by and Order options.
- In the Sort by dropdown, choose "Month".
- In the Order dropdown, select Descending. If your months are formatted as text (e.g., "January", "February"), this may sort them alphabetically backward (e.g., "September", "October," etc.). If they are properly formatted as dates, it will sort them in reverse chronological order.
Pro Tip: You can also sort your columns based on their Grand Total. If you want to see which month had the highest overall sales across all categories, just click the "Sort by" dropdown under Columns and select "SUM of Revenue." Set the order to Descending, and the month with the most revenue will shuffle to the far right (or left depending on your setup) of the grand totals column.
Advanced Tips and Common Issues
Sorting is usually straightforward, but a few quirks can trip you up. Here's how to navigate them.
What About Custom Sorting?
One major limitation of Google Sheets pivot tables compared to Excel is the lack of a simple drag-and-drop manual sort. For instance, you can't easily arrange sales regions in a specific non-alphabetical, non-value order (e.g., East, West, North, South).
The best workaround is to add a "helper column" to your source data.
- Go back to your original source data tab.
- Insert a new column next to the column you want to custom sort (e.g., next to the "Region" column). Let's call it "Region Sort Order."
- In this new column, assign a number to each item that corresponds to the order you want. For example:
- Refresh your pivot table data source to include this new column.
- In the Pivot table editor, add your "Region Sort Order" field to the Rows section, placing it above the "Region" field. Then, sort the "Region Sort Order" field in Ascending order.
- You can hide the sort order numbers by unchecking "Show totals" for that field to clean up the look.
Your pivot table will now follow your custom numeric order rather than sorting alphabetically.
Why Does My Sort Keep Resetting if I Change the Data?
It's important to remember that pivot tables are dynamic. They are designed to re-calculate and re-organize every time you change a field, add new data, or interact with filters. If you sort your Product Categories by SUM of Revenue but then add a new filter that changes those revenue totals, the pivot table will automatically re-sort itself based on the new totals. This isn't a bug - it's the feature that keeps your analysis accurate and up-to-date with your current view of the data.
Final Thoughts
With these steps, you now have the skills to professionally sort any pivot table in Google Sheets. You can organize your data alphabetically for reference or, more powerfully, sort by key performance values to instantly spot top-performers, find opportunities, and answer critical business questions. You've transformed your simple summary table into a true data analysis tool.
While mastering pivot tables is a huge leap forward, the process of manually exporting data from different platforms, cleaning it up in spreadsheets, and building these reports every week is still a major time sink for most marketing and sales teams. Instead of spending your Mondays just wrangling data, we created Graphed. We connect directly to your data sources - like Google Analytics, Shopify, and Facebook Ads - so you can skip the spreadsheets entirely. You can ask for a dashboard in plain English, like "Show me my top Shopify products by sales and website traffic from Google Analytics for the last 30 days," and instantly get a live, interactive dashboard that updates automatically.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?