Summarize a Transaction List With an Excel Pivot Table

Got a long list of transactions and need totals by category or by month? Click any cell in the list, choose Insert > PivotTable, leave New Worksheet selected and press OK. In the PivotTable Fields pane that opens, drag the category (or date) field into Rows and the amount field into Values. Excel totals each category, adds a grand total, and leaves your list untouched.

Menus match Windows Excel in Microsoft 365; Mac, web and older versions come later.

Plan the report before you click Insert

Match your question to the four areas

A pivot table (Microsoft spells it PivotTable) is a summary report built from a list. Each column of the list becomes a field, and you place fields into four areas at the bottom of the Fields pane. Where a field goes depends on the question you’re asking:

Your question Rows Columns Values Filters
What did each region sell? Region Revenue
How did each region do each month? Region Order Date (grouped by month) Revenue
Which product sold the most units? Product Units
How many orders did each salesperson take? Salesperson Order ID (as Count)
What are laptop sales by region, ignoring other products? Region Revenue Product = Laptop

A useful rule of thumb: the thing you’d write down the left edge of a hand-drawn summary goes in Rows, the thing you’d write across the top goes in Columns, the number you’re adding goes in Values, and anything you’d say “only for” about goes in Filters. Long lists such as customer names read better in Rows; short ones such as years or product types fit across in Columns.

Check the list

Most pivot table headaches start in the source data. Two minutes here saves a lot of confusion later. Microsoft’s data tips boil down to this checklist:

  • One header row, every column named. Short, unique names such as Order Date, Region, Product, Units, Revenue. No two-row headings and no blank header cells.
  • One record per row. Each row is one order, one expense, one response. No subtotal rows mixed in.
  • No merged cells and no blank rows or columns inside the data. A blank row can make Excel stop the range early and quietly leave records out.
  • One kind of data per column. Dates in the date column, numbers in the number columns. A number column that contains text gets counted instead of summed.
  • Consistent labels. “West” and “West ” (trailing space) become two separate rows in the report.

Then turn the list into an Excel table: click a cell in it, press Ctrl+T (or choose Insert > Table), confirm My table has headers and click OK. Give it a name such as Orders in the Table Name box on the Table Design tab. A table grows when you add rows, so the pivot table picks up new records at the next refresh without you editing its source range. If repeated rows from a merged export are a risk, remove duplicate rows now, because a pivot table will happily count them twice. And if a column you need lives in another table, such as a category for each product code, an XLOOKUP column can bring it in first.

Build the pivot table in Excel for Windows

  1. Click one cell inside the data. Excel detects the table or the surrounding block. Select the whole range yourself only if the data has gaps.
  2. Open the command. Select the Insert tab, then PivotTable at the left end of the ribbon. If a small menu opens, choose From Table/Range for data on a worksheet.
Excel Insert tab with the PivotTable button menu open and From Table/Range highlighted
(1) Open the Insert tab, (2) click the PivotTable button, and (3) choose From Table/Range for data on your worksheet. (Illustration)

The other entries in that menu are for special sources: an external data source such as a database, the Data Model (several related tables), or Power BI datasets your organization shares. A single worksheet list doesn’t need any of them.

  1. Confirm the source and location. The Table/Range box should show your table name (Orders) or a range that reaches your last row and column. Keep New Worksheet so the report has room to grow; choose Existing Worksheet only if you have a large empty area for it. For a single table, you can leave Add this data to the Data Model unchecked. Click OK.
PivotTable from table or range dialog box with the Orders table selected and New Worksheet chosen
(1) Confirm the table or range, (2) keep New Worksheet selected, and (3) click OK. (Illustration)
  1. Place the fields. A new sheet opens with an empty placeholder on the left and the PivotTable Fields pane on the right. Check a field to let Excel place it: non-numeric fields go to Rows, date and time fields go to Columns, and numeric fields go to Values. Drag a field between the area boxes to override that.
  2. Read the heading. “Sum of Revenue” means Excel is adding. “Count of Revenue” means Excel found text in that column; see the average-order question in the example below.
Finished pivot table showing Sum of Revenue by region next to the PivotTable Fields pane with Region in Rows and Revenue in Values
(1) Check Region and (2) check Revenue in the PivotTable Fields pane; (3) the pivot table shows total revenue for each region. (Illustration)
  1. Format the numbers through the field. In the Values area, click the arrow next to Sum of Revenue, choose Value Field Settings > Number Format, pick Currency or Number with a thousands separator, and click OK twice. Formatting the field keeps the format when the layout changes; formatting cells directly can be lost.
  2. Save. The pivot table is stored with the workbook.

The Fields pane only appears while a cell inside the pivot table is selected. If it vanishes, click inside the report, or select Field List on the PivotTable Analyze tab.

Let Excel suggest a layout instead

If you’re not sure where to start, select a cell in the data and choose Insert > Recommended PivotTables. Excel previews a few layouts built from your columns; pick one and adjust it in the Fields pane. Microsoft notes that recommendations use Microsoft 365 connected experiences, so they’re missing when those experiences are turned off on your device or by your organization. If your plan includes Copilot in Excel, it can also propose a summary; see how to use Copilot in Excel to analyze a table.

Four questions answered from one order list

Priya runs a small equipment shop and keeps a quarter’s orders in a table named Orders. The data is fictional:

Order Date Region Product Units Revenue
1/6/2026 East Laptop 2 2400
1/9/2026 West Monitor 5 1250
1/14/2026 North Laptop 1 1200
1/20/2026 East Monitor 3 750
1/27/2026 West Laptop 3 3600
2/3/2026 North Keyboard 10 450
2/10/2026 East Keyboard 8 360
2/17/2026 West Keyboard 6 270
2/24/2026 North Monitor 4 1000
3/3/2026 East Laptop 1 1200
3/10/2026 West Monitor 2 500
3/17/2026 North Laptop 2 2400

Which product moves the most units, and which earns the most?

Put Product in Rows, then drag both Units and Revenue into Values. The report shows Keyboard 24 units and 1,080 revenue, Monitor 14 units and 3,500, Laptop 9 units and 10,800, with a grand total of 47 units and 15,380. Right-click a Revenue number and choose Sort > Sort Largest to Smallest to rank them. The answer to “best seller” depends on which column you sort: keyboards lead on volume, laptops on money.

How did each region do month by month?

Clear the fields, then put Region in Rows, Order Date in Columns and Revenue in Values. Group the dates by month (steps below) and the grid reads:

Sum of Revenue Jan Feb Mar Grand Total
East 3,150 360 1,200 4,710
North 1,200 1,450 2,400 5,050
West 4,850 270 500 5,620
Grand Total 9,200 2,080 4,100 15,380

West has the highest quarter total, but nearly all of it came in January. North is the only region that grew each month. That kind of pattern is hard to spot in the raw list.

Group Order Date by month

Current Excel versions often group a date field automatically when you add it. If you see one row per day instead:

  1. Right-click any date in the pivot table and choose Group.
  2. In the Grouping box, adjust Starting at and Ending at if you want to trim the range.
  3. Under By, select Months. Select Quarters and Years too if the data covers more than one year, so January 2025 and January 2026 don’t merge into one row.
  4. Click OK.

The same command groups numbers into bands: right-click a Units label (with Units in Rows), choose Group and type an interval such as 5. To group text items, hold Ctrl, click the items (for example East and North), right-click and choose Group; rename the group through PivotTable Analyze > Active Field > Field Settings. Right-click a group and choose Ungroup to undo it. Microsoft’s page on grouping or ungrouping data in a PivotTable covers every option. This is different from outlining rows on an ordinary sheet, which is explained in how to group rows in Excel.

What share of the total does each region bring in?

Remove Order Date from Columns so only Region and Revenue remain. Drag Revenue into Values a second time, right-click a number in the second copy and choose Show Values As > % of Grand Total. The dollar column stays, and the new column shows East 30.62%, North 32.83% and West 36.54%. Showing the same field two ways side by side is often more convincing in a report than either number alone.

To limit the report to one product, drag Product into Filters, or right-click it in the field list and choose Move to Report Filter. Click the dropdown arrow next to the filter above the pivot table, check the items you want to show (here, Laptop) and click OK. If the list shows no check boxes, turn on Select Multiple Items at the bottom of it first. With only Laptop checked, East, North and West each show 3,600, a third of the 10,800 in laptop revenue.

What does an average order look like?

Put Product in Rows and Revenue in Values. Values fields add numbers by default; to average instead, click the arrow next to the field in the Values area, choose Value Field Settings, and on the Summarize Values By tab pick Average (or Count, Max, Min or another function). Right-clicking a number in the report and choosing Summarize Values By does the same. With Priya’s data, Average of Revenue by product gives Laptop 2,160, Monitor 875 and Keyboard 360 per order, a figure that a sum hides.

If a field arrives as “Count of” when you wanted a sum, Excel has read at least part of that column as text. Common causes are numbers stored as text after an import (look for the small green triangle in the cell corner), stray words such as “n/a”, or blank cells. Fix the source cells, refresh, and then switch the field back to Sum.

The Show Values As tab in the same dialog turns numbers into percentages of the grand total, the column total or the row total, without touching the source. And the Custom Name box renames a heading such as “Sum of Revenue”. Microsoft suggests waiting to rename until the layout is final, since changing the calculation rewrites the name, and Excel won’t accept a custom name identical to an existing field name.

When the totals look wrong

What you see Likely cause Fix
Count of Revenue instead of Sum Text or blanks in the number column Clean the source, refresh, switch to Sum
A category appears twice Trailing space, typo or different capitalization in the label Make the labels identical in the source and refresh
A (blank) row appears The source includes empty rows or whole empty columns Point the source at the table or the exact range
New orders are missing Not refreshed, or the source range is too short Refresh; then Change Data Source if needed
Totals far too high Duplicate rows, or subtotal rows inside the source list Remove duplicates and delete subtotal rows from the list
“The PivotTable field name is not valid” A column in the range has no header Name every column, then try again
PivotTable button is gray You’re still editing a cell, or the sheet is protected Press Enter or Esc; unprotect from the Review tab
Column widths jump after refresh Autofit on update is on PivotTable Analyze > Options > Layout & Format: clear Autofit column widths on update

Refresh the report and fix a short source range

A pivot table reads from a saved snapshot of the source called the pivot cache, so typing a new order into the list doesn’t change the report until you refresh it. Microsoft’s Refresh PivotTable data page lists these options:

  • Refresh one pivot table: right-click inside it and choose Refresh, or press Alt+F5, or select PivotTable Analyze > Refresh in the Data group.
  • Refresh everything in the workbook: click the arrow under Refresh on the PivotTable Analyze tab and choose Refresh All.
  • Refresh whenever the file opens: choose PivotTable Analyze > Options, open the Data tab and check Refresh data when opening the file.

If a refresh still misses new rows, the pivot table is pointing at a fixed range that ends above them. Click inside the report, choose PivotTable Analyze > Change Data Source > Change Data Source, and type or select the full range in the Table/Range box, or enter the table name. Microsoft documents this on its change the source data page. Converting the list to a table, as described earlier, prevents the problem next time.

A quick sanity check for any report: total the Revenue column of the source list (see how to sum a column in Excel) and compare it with the pivot table’s grand total. If they differ, a filter is active or some rows are outside the source range.

PivotTable or PIVOTBY?

Excel for Microsoft 365, 2024 and 2021 also list a PIVOTBY function that builds a similar summary with a formula. Microsoft is clear that it isn’t directly related to the PivotTable feature. The basic form is =PIVOTBY(row_fields,col_fields,values,function), so with Priya’s table, =PIVOTBY(Orders[Region],Orders[Product],Orders[Revenue],SUM) in an empty cell returns a region-by-product grid with totals. The result spills into the cells below and to the right, so leave room, and a blocked range shows #SPILL!.

Choose a PivotTable when Choose PIVOTBY when
You want to explore by dragging fields around The summary must recalculate instantly like any formula, with no refresh
You need slicers, PivotCharts or date grouping menus The result feeds other formulas on a formula-driven sheet
The person using the file doesn’t write formulas You want the logic visible and auditable in one cell
Anyone on Excel 2019 or older will open the workbook Everyone uses a version that has the function

Optional arguments for headers, totals, sorting and filtering are on Microsoft’s PIVOTBY function page. If the formula shows #NAME?, your Excel doesn’t include it.

After the report is built

Move, copy out or delete it

  • Move it: click inside, choose PivotTable Analyze > Move PivotTable, and pick a new location.
  • Copy the numbers as plain values: select the whole report, copy it, and paste with Paste Values on another sheet. The copy no longer refreshes, which is handy for a monthly snapshot or an email.
  • Delete it: select the entire pivot table and press Delete, or delete its sheet if nothing else lives there. The source data is not affected. A deleted sheet can’t be brought back with Ctrl+Z, so check the sheet first.

While you’re experimenting with the layout, a misplaced field is harmless: press Ctrl+Z, drag it back out of the area, or uncheck it to start over.

Mac and browser differences

The idea is identical everywhere: select the data, choose Insert > PivotTable, place fields in the four areas. Microsoft’s page on how to create a PivotTable to analyze worksheet data has separate Windows, Web and macOS tabs. In Excel for the web, Insert > PivotTable opens the Insert PivotTable pane: choose New sheet or Existing sheet on the Create your own PivotTable card, and change the range in the Source box if needed. To change the calculation there, right-click a value and choose Summarize Values By. On a Mac, Insert > PivotTable opens the Create PivotTable dialog with New Worksheet or Existing Worksheet; the calculation lives under Field Settings, on the Summarize by and Show data as tabs. Recommended PivotTables in the browser need a Microsoft 365 subscription. Excel 2019 and 2016 on Windows build pivot tables the same way, but they lack PIVOTBY.

Pivot table questions

Can I build one pivot table from several sheets?

Yes, when the sheets hold related tables, such as Orders and a Products list sharing a product code. Format each as an Excel table and check Add this data to the Data Model when you create the pivot table (or use From Data Model in the PivotTable menu), then relate the tables by the shared column. If the sheets are identical monthly copies, it’s simpler to combine them into one table first, for example with Power Query.

How do I get rid of “Sum of” in the headings?

Open Value Field Settings and type a new name in Custom Name, or select the heading cell and type over it. A quick way to clean many headings at once is Ctrl+H: find “Sum of ” and replace it with nothing. Because Excel rejects a name identical to the source field, add a trailing space or use a slightly different word, such as “Revenue ” or “Total Revenue”.

Is a pivot table better than the Subtotal command?

They solve different problems. Subtotal inserts total rows into the sorted list itself, which suits a printed list with section totals. A pivot table builds a separate report you can rearrange, filter and refresh without touching the list.

Start small with your own data: one field in Rows, one in Values, and compare the grand total with the list total. Once that matches, add a column field or a filter, one change at a time, and refresh after adding a test row to confirm the report keeps up. When the numbers are right, Insert > PivotChart draws a chart that stays linked to the report; for a static chart from ordinary cells, see how to make a bar graph in Excel or make a line graph from your data.