An Excel Pivot Table summarises data by drag and drop: from a table of hundreds or thousands of order lines, you drag "Category" into rows, "Month" into columns and "Revenue" into values, and you instantly have a monthly revenue table without writing a single formula. It is a skill that almost every office, accounting and sales recruitment test in Vietnam asks about, because it replaces a whole afternoon of adding things up with SUMIFS. This lesson goes from preparing the data, creating a Pivot Table, dragging fields, grouping by month and filtering with Slicers, to a worked three-month revenue report whose numbers add up so you can rebuild it yourself.
By the end of this lesson, you will be able to:
- Check and fix a source table so a Pivot Table works correctly (one header row, no merged cells, dates stored as real dates).
- Create a Pivot Table and place fields correctly in the 4 areas: Filters, Columns, Rows and Values.
- Switch between Sum, Count and Average and show values as a percentage of the total.
- Group dates by month, quarter and year, and filter with Filters, Slicers and Timelines.
- Build a complete revenue report by month, category and sales channel and check the totals yourself.
Learning office IT skills properly? PivotTables, charts and dashboards are step 5 of the roadmap, after Excel fundamentals and lookup and data cleaning. See the 8-step office IT skills roadmap (Excel, Word) to learn in the right order.
What is a Pivot Table and when should you use one?
A Pivot Table is an Excel table that automatically sums, counts or averages a source table by the groups you choose. The source table stays untouched; the Pivot Table only reads and summarises it. You can "pivot" your view in seconds: from category to salesperson, to sales channel, to month.
Questions a Pivot Table answers quickly
- What was revenue each month, and which months went up or down?
- What percentage of revenue does each product category bring in?
- How many orders did each salesperson or branch handle this quarter?
- How do online and in-store sales differ for each category?
Pivot Table or SUMIFS?
SUMIFS suits a fixed number inside a report template that already exists. A Pivot Table suits exploring data, changing views constantly, or reports with many groups you do not know in advance (new products, new staff). In real jobs, many people use a Pivot Table to find the numbers first and only then build a fixed report template with SUMIFS.
Preparing the source data: where 80% of errors come from
A Pivot Table is only correct when the source table is "flat": each row is one transaction and each column is one kind of information. Most "cannot group by month", "wrong total" and "(blank)" problems come from the source table, not from the Pivot Table.
5 conditions of a good source table
- Exactly one header row, a unique name for every column, no blank column names.
- No merged cells and no subtotal rows mixed into the data.
- No blank rows or blank columns in the middle of the table.
- The date column holds real dates (right-aligned), not text typed as "05/01/2026" and left-aligned.
- The amount column holds numbers, not values typed with a currency letter or spaces.
If data exported from sales software has extra spaces, numbers stored as text, or needs prices looked up by product code, clean it first using the techniques in VLOOKUP in Excel: syntax, a price lookup example and fixing errors.
Turn the range into a Table (Ctrl + T)
Click a cell in the data, press Ctrl + T, tick "My table has headers", then name the table on the Table Design tab, for example Orders. The benefit: when you add new orders at the bottom, the Table grows automatically and the Pivot Table only needs a Refresh, with no need to reselect the data range.
Privacy when sending files with customer data
Note: A Pivot Table stores a copy of the source data (the pivot cache) inside the file. Even if you delete the source sheet, the recipient can double-click a total cell and see every detailed row again, including customer names and phone numbers. When sending a report outside the company, paste values (Paste Values) into a new file or export to PDF, and follow your company's data protection rules.
Creating a Pivot Table and dragging fields into the 4 areas
The steps below follow the English interface of Microsoft 365 and Excel 2016 or later; localised versions use equivalent menu names, and button positions can differ slightly in older versions.
Steps to create one
- Click any cell in the
Orderstable. - Choose Insert → PivotTable. The dialog fills in the table name.
- Choose New Worksheet to put the Pivot Table on a new sheet, then click OK.
- The PivotTable Fields pane appears on the right: the column list at the top, the 4 areas below.
The four areas and what they do
| Area | Role | Usually holds | Example |
|---|---|---|---|
| Rows | Each distinct value becomes a row | The main grouping field | Category, Salesperson |
| Columns | Each distinct value becomes a column | A field with few values | Month, Channel |
| Values | The numbers being calculated | Numeric columns | Revenue (Sum), Order ID (Count) |
| Filters | Filters the whole table by one condition | A field that sets the scope | Branch, Channel |
A placement tip: put fields with many values (dozens of products) in Rows so the table grows downwards, and fields with few values (3 months, 2 channels) in Columns so the table does not get too wide.
Changing the calculation in Values
Drag a numeric column into Values and Excel defaults to Sum. Drag a text column such as Order ID into Values and Excel defaults to Count. To change it, click the field in the Values area → Value Field Settings, and choose Sum, Count, Average, Max or Min. In the same dialog, the Show Values As tab can display "% of Grand Total", and the Number Format button formats numbers with thousands separators.
Grouping by month, quarter and year
Sales data is recorded by day, but your manager asks by month. This is where a Pivot Table saves the most time (Figure 1).
Photo: Shixart1985 / Wikimedia Commons, CC BY 2.0
How to group dates
- Drag the Date column into Rows or Columns. Excel 2016 and later usually groups it into Years, Quarters and Months automatically.
- If it does not: right-click a date cell in the Pivot Table → Group.
- Select Months, and also Years if the data covers more than 12 months, so that January 2025 and January 2026 are not added together.
- Click OK. To undo, right-click → Ungroup.
The "Cannot group that selection" error
This message almost always means the date column contains cells that are not real dates: blanks, text, or dates typed in the wrong format. To find them, filter the Date column in the source table; any left-aligned cell, or anything listed as text, is the culprit. After fixing it, go back to the Pivot Table, click Refresh and group again.
Grouping numbers into ranges
Group also works on numeric columns, for example grouping order values into bands such as 0–499,000 and 500,000–999,000 VND to see how much customers usually spend. Right-click a number cell → Group, then enter Starting at, Ending at and By (the step).
Filtering: Filters, Slicers and Timelines
The Filters area and header filters
A field in the Filters area shows a drop-down above the table; choose Channel = Shopee and the whole table counts only Shopee orders. The arrow on the Row Labels header also offers Label Filters (by text) and Value Filters, where Top 10 quickly gives you the 5 or 10 best-selling products.
Slicers: clickable filter buttons
Click the Pivot Table → PivotTable Analyze tab → Insert Slicer, and pick Channel. Excel creates a panel of buttons; click "Shopee" to filter, hold Ctrl to select several. Slicers are easy for managers or colleagues who are not comfortable with Excel, and one Slicer can control several Pivot Tables at once through Report Connections.
Timelines: filtering by time
Insert Timeline (only for date columns) creates a slider by month, quarter or year. Drag across January to March to see Q1 at a glance. Combine a Pivot Table, a PivotChart and a few Slicers and Timelines on one sheet and you already have a simple dashboard (Figure 2).
Photo: Carlos Muza kmuza / Wikimedia Commons, CC0
Worked example: a shop's Q1 revenue report
Lan is the admin for a small shop selling 3 product categories through 2 channels: Shopee and the physical store. Her manager asks: what was revenue each month of Q1 2026 by category, which category has the largest share, and how much did Shopee sell? The source data from sales receipts (Figure 3) is entered as 12 rows (shortened so you can type it in yourself; revenue in thousands of VND).
Photo: Tessa Bury / Wikimedia Commons, CC BY 4.0
The source table
| Date | Order ID | Category | Channel | Quantity | Revenue |
|---|---|---|---|---|---|
| 05/01/2026 | DH001 | Cosmetics | Shopee | 2 | 360 |
| 12/01/2026 | DH002 | Housewares | Store | 1 | 450 |
| 20/01/2026 | DH003 | Fashion | Shopee | 3 | 540 |
| 28/01/2026 | DH004 | Cosmetics | Store | 1 | 180 |
| 03/02/2026 | DH005 | Housewares | Shopee | 2 | 900 |
| 10/02/2026 | DH006 | Fashion | Store | 2 | 360 |
| 18/02/2026 | DH007 | Cosmetics | Shopee | 4 | 720 |
| 25/02/2026 | DH008 | Housewares | Store | 1 | 450 |
| 04/03/2026 | DH009 | Fashion | Shopee | 5 | 900 |
| 11/03/2026 | DH010 | Cosmetics | Store | 3 | 540 |
| 19/03/2026 | DH011 | Housewares | Shopee | 2 | 900 |
| 27/03/2026 | DH012 | Fashion | Store | 1 | 180 |
Dates are written day/month/year, as in Vietnam.
Step 1: build the monthly revenue table
- Ctrl + T, name the table
Orders; Insert → PivotTable → New Worksheet. - Drag Category into Rows, Date into Columns (grouped by Months) and Revenue into Values (Sum).
- Value Field Settings → Number Format → Number, with the thousands separator ticked.
Result (thousands of VND):
| Category | January | February | March | Total |
|---|---|---|---|---|
| Cosmetics | 540 | 720 | 540 | 1,800 |
| Fashion | 540 | 360 | 1,080 | 1,980 |
| Housewares | 450 | 1,350 | 900 | 2,700 |
| Total | 1,530 | 2,430 | 2,520 | 6,480 |
Step 2: check the totals yourself
Down the columns: January is 540 + 540 + 450 = 1,530; February is 720 + 360 + 1,350 = 2,430; March is 540 + 1,080 + 900 = 2,520. Across the rows: 1,800 + 1,980 + 2,700 = 6,480, matching 1,530 + 2,430 + 2,520 = 6,480. Cross-check with the source: select the whole Revenue column and the status bar at the bottom of Excel shows Sum = 6,480. When the two match, the Pivot Table has picked up all the data.
Step 3: shares and filtering by channel
- Drag Revenue into Values a second time, Show Values As → % of Grand Total: Housewares 2,700 ÷ 6,480 ≈ 41.7%, Fashion 1,980 ÷ 6,480 ≈ 30.6%, Cosmetics 1,800 ÷ 6,480 ≈ 27.8% (adding up to 100.1% because of rounding).
- Drag Order ID into Values (Count): 4 orders per category, 12 in total; the average order value is 6,480 ÷ 12 = 540 thousand VND.
- Insert a Channel Slicer and click Shopee: the total becomes 4,320 (360 + 540 + 900 + 720 + 900 + 900). Click Store: 2,160 (450 + 180 + 360 + 450 + 540 + 180). Check: 4,320 + 2,160 = 6,480.
The answer for the manager fits in 3 lines: Q1 revenue was 6,480,000 VND (about USD 250), rising each month from January to March; Housewares had the largest share at about 41.7%; Shopee brought in 4,320,000 VND, two thirds of revenue.
Refreshing Pivot Tables and common mistakes
Refresh: Pivot Tables do not update themselves
After you edit or add source data, the Pivot Table keeps showing the old numbers until you right-click → Refresh, or use Data → Refresh All (Ctrl + Alt + F5) to update every Pivot Table in the file. If the source is a plain range rather than a Table, rows added at the bottom fall outside the range; fix this with PivotTable Analyze → Change Data Source, or convert the source into a Table.
Counting instead of summing
Sign: Values shows "Count of Revenue" with an unusually small number. Cause: the Revenue column contains blank or text cells, so Excel treats the whole column as text. Fix: correct those cells in the source, Refresh, then switch back to Sum in Value Field Settings.
"(blank)" and odd duplicate rows
Sign: a "(blank)" row, or two separate "Cosmetics" rows. Cause: blank rows in the source, or the same name typed with different spaces, capitalisation or accents. Fix: delete blank rows, use TRIM and agree on one way of typing each category name.
Formulas pointing at the Pivot Table turn into GETPIVOTDATA
When you type "=" and click a cell inside a Pivot Table, Excel creates a GETPIVOTDATA function instead of a cell address. It is correct, but filling the formula down does not behave the way you expect. To turn it off: PivotTable Analyze → Options → untick Generate GetPivotData.
Frequently asked questions
Does an Excel Pivot Table update automatically when data is added?
No. You have to click Refresh (or Refresh All). To refresh whenever the file opens, go to PivotTable Options → Data tab → tick Refresh data when opening the file.
Does Google Sheets have Pivot Tables?
Yes. In Google Sheets choose Insert → Pivot table; the Rows, Columns, Values and Filters areas work much like Excel. Some features, such as Timelines and the way dates are grouped, look a little different, but the rules for preparing data are exactly the same.
Can I build a Pivot Table from several sheets?
The simplest way is to combine sheets with the same structure into one source table first (add a "Branch" column to tell them apart). Newer versions of Excel have Power Query and the Data Model to connect several tables, but that is an advanced skill best learned after you are comfortable with single-table Pivot Tables.
Why does grouping by month add several years together?
Because you selected only Months when grouping. Select Years as well so each year's months are kept separate.
Practice exercise and self-assessment
- Type the 12-order table above into Excel or Google Sheets, create a Table and a Pivot Table as in the example.
- Change the layout: Channel in Rows, Category in Columns. Write down Cosmetics revenue through the store.
- Add a new order: 15/03/2026, DH013, Cosmetics, Shopee, 2, 360. Refresh and write down total revenue for March.
- Filter the Top 1 category by total quantity sold.
Answers and self-assessment criteria
- Pass question 2: Cosmetics through the store = 180 + 540 = 720 thousand VND.
- Pass question 3: March = 2,520 + 360 = 2,880; quarter total = 6,480 + 360 = 6,840 thousand VND (if you still see 6,480, you have not refreshed or the source is not a Table).
- Pass question 4: Fashion with 3 + 2 + 5 + 1 = 11 items (Cosmetics 10, Housewares 6, based on the original 12 orders).
- Not yet: the Pivot Table total differs from the Revenue column total in the source and you cannot explain why.
Once you are comfortable with Pivot Tables, move on to the next step of the roadmap: PowerPoint and Google Workspace for teamwork, where you learn to present these numbers as clean slides and share reports so the whole team can view and edit them together.
Keep learning step by step: See the 8-step office IT skills roadmap (Excel, Word) on NAMBIN, from Excel fundamentals to a complete sales and inventory report pack and recruitment tests.


