How to Sort a Pivot Table by Value
Learn how to sort pivot table rows by a summed value, largest to smallest, and what to check when the order looks wrong or a PDF copy loses it.
A pivot table summarizes a long list of rows into totals, such as sales by region or hours by project. By default, though, the row labels appear in alphabetical order, so your biggest region might sit in the middle of the table. If you want the highest totals at the top, you need to sort the rows by the value itself.
This guide is for anyone who has a pivot table in a spreadsheet file, or a summary table in a PDF that they need to reorder. You will learn how to sort the rows by a summed value, which settings matter, and how to check that the numbers still line up after the change.
Sorting a live pivot table happens in your spreadsheet program. OmniDoc's role is around that step: you can export a table from a PDF to a spreadsheet file, and you can translate a spreadsheet, keeping its tables and layout intact. The sections below cover both cases.
How do you sort a pivot table by value? The short answer
Click a cell in the row labels, open the sort options for that row field, choose to sort by the summed value column, and set the order to descending for largest first. Then check that the top rows match the totals you expect.
| Your situation | What to do | Why |
|---|---|---|
| Pivot table is in a .xlsx file | Sort the row labels by the summed value column in your spreadsheet program | The order follows the numbers instead of the alphabet |
| Table exists only inside a PDF | Export the table to a spreadsheet file (.xlsx) with the PDF editor, then sort it | A PDF table is fixed text, and sorting needs spreadsheet cells |
| Table has several value columns | Pick the one column you want to rank by before you confirm | Sum and count columns produce different orders |
| You need a translated copy in the same order | Sort first, save, then translate the file on omnidoc.top and compare the row order | The translated file should keep the layout, but you should confirm it |
Before you start
Check these points first. Each one prevents a common mistake.
- Confirm the value field. Look at the column headings in the values area. If it says count, you will sort by number of records, not by total. Sort by the field that matches the question you are answering.
- Identify the file type. Click a number in the table. If you can select that single number and see it as text, the table is editable. If the whole table behaves like one picture, it is an image or scanned page, so you will need OCR before you can work with the numbers.
- Save a copy. Sorting changes the order of rows on screen and in the file. A copy lets you compare before and after, and it protects the original if you need the default order again.
- Look for subtotals and grand totals. Subtotals usually move with their group. The grand total normally stays at the bottom, so do not be surprised if it does not move with the rows.
- Decide on descending or ascending. Descending puts the largest totals first, which suits rankings. Ascending puts the smallest first, which suits finding low performers or the lowest costs.
Sorting a pivot table by value, step by step
- Open the file in your spreadsheet program. Use the .xlsx copy of the pivot table. If your table is inside a PDF, convert it first using the steps in the next section.
- Click any cell in the row labels. The sort applies to the row field you select, so the cursor needs to be inside that field's area.
- Open the sort options for the row field. Pivot tables include a sort control on the row header. Use it to reach the settings for this field.
- Choose to sort by values instead of labels. Alphabetical order is the default. You want the order to come from the numbers in the values area.
- Select the summed value column. If the table has more than one value column, pick the one you want to rank by. This is the step that decides which total controls the order.
- Set the order. Choose descending for the largest totals at the top, or ascending for the smallest.
- Confirm and review. The rows reorder, and each label stays with its own numbers. Scroll through to make sure the order looks right.
- Save as a new copy. Keep the sorted version separate from your original so you can compare them later.
If your table is inside a PDF, open it in the OmniDoc desktop client, use the PDF editor to export the table to a spreadsheet file (.xlsx), and then follow the steps above. An exported table is a starting point: check that every row and column arrived before you sort.
Check the result
Once the rows are sorted, compare them against the source before you share the file. These checks catch a common problems.
| Check | How to see it | If it's wrong |
|---|---|---|
| Largest total is at the top | Read the first two rows and compare them with the values column | Reapply the sort, and confirm you picked the summed value field |
| Labels still match their numbers | Spot-check one row against the source data | Undo the sort, then sort the row field again, not a single value column |
| Grand total is unchanged | Compare the grand total before and after sorting | If it changed, you probably filtered the table by accident; undo and review the filters |
| Translated copy keeps the order | Compare the row order in the translated output with your sorted source | If the order differs, check the output for changed labels and confirm important figures against the source |
Translation can change labels, so review any figure that matters before you share the file. Compare key totals against the original rather than trusting the translated text alone.
📝 Summary
To sort a pivot table by value, sort the row labels by the summed value column and choose descending for the largest totals first. Save a copy before you sort, and check the top rows and grand total afterward. If your table lives in a PDF, export it to a spreadsheet file first so you can sort the rows.
❓ FAQ
1. Why does my pivot table sort alphabetically by default?
Pivot tables list row labels alphabetically until you tell them to sort by a value. Once you choose to sort by the values field, the rows follow the numbers instead.
2. Can I sort by count instead of sum?
Yes. Pick the count column in the sort settings, as long as it appears in the values area. Sorting by count ranks rows by how many records they contain, which can give a different order than sorting by total.
3. Why did my grand total move after sorting?
Grand totals usually stay at the bottom of the table, while subtotals move with their groups. If the grand total looks wrong, check whether a filter was applied by accident and undo it.
4. Does sorting change the numbers in the table?
No. Sorting only changes the order of the rows. Each label keeps its own values, so you can compare the totals before and after to confirm nothing was altered.


