Blog
How to Create a Pivot Table in Excel, Step by Step
A pivot table in Excel turns a long list of records, one row per score, purchase or attendance entry, into a summary by student, category or month, without writing a single formula. To create one, click inside your data, choose Insert > PivotTable, confirm the range, then drag fields into Rows, Columns and Values. That part takes a minute. What takes longer is the cleanup when a number quietly comes out wrong because of a blank row, a score stored as text or a refresh nobody ran, and that wrong number ends up on a slide at a data meeting. This guide covers both: the build, and the reasons pivot numbers drift from the source.
Prepare the source data first
Microsoft's guide to creating a PivotTable lists the conditions the source needs. Data should be organized in columns with a single header row, with no blank rows or columns, and each column should hold one data type. Dates mixed with text, or a score column with "EX" or "absent" typed into a few cells, are the usual culprits behind odd results.
Format the source as a table with Ctrl+T before you build anything. When the source is a table, new rows are included the next time the pivot refreshes and new columns appear in the field list. A pivot built on a plain range ignores rows added below it until you change the data source.
A pivot table never changes your data. It works from a snapshot called the cache, so you can rearrange it freely without touching the original list.
How to create a pivot table in Excel
- Click any cell in the source data.
- On the Insert tab, click PivotTable and choose From Table/Range.
- Check that Table/Range covers all the data.
- Choose New Worksheet or Existing Worksheet for the location and click OK.

If you're not sure what layout you want, try Insert > Recommended PivotTables. Excel analyzes the data and previews a few summaries; pick one and it lands on a new sheet. In Excel for the web, Recommended PivotTables are available to Microsoft 365 subscribers.
Place fields in Rows, Columns, Values and Filters
Check a field in the PivotTable Fields pane and Excel puts it in a default area: non-numeric fields go to Rows, dates to Columns, and numbers to Values. Drag a field between areas to change that.
- Rows: the vertical breakdown, such as student or assignment category.
- Columns: the horizontal comparison, such as month or class period.
- Values: the numbers to summarize, such as scores or dollars spent.
- Filters: conditions for the whole table, such as school year or teacher.

Two or more fields in Rows create a hierarchy with subtotals at each level, as above. If you'll paste the result into a report, choose Design > Report Layout > Show in Tabular Form and Subtotals > Do Not Show Subtotals to get a flat, conventional table.
Change how values are summarized
Numbers in Values default to Sum. For an average score or the number of entries, click the field's arrow in the Values area and choose Value Field Settings. On Summarize Values By you can pick Sum, Count, Average, Max, Min and more, and Number Format applies thousands separators or a fixed number of decimals to the whole field.

The Show Values As tab turns numbers into ratios. In a household spending log, % of Grand Total shows each category's share of the year's spending; % of Column Total shows the mix within each month. Drag the same amount field into Values twice, leave one as Sum and set the other to % of Grand Total, and you get dollars and share side by side.
Group dates by month or quarter
In current versions, putting a date field in Rows or Columns groups it by year, quarter and month automatically. For a different grouping, right-click a date and choose Group, then pick Months, Quarters or Years. If Group is grayed out, the date column contains text dates or blanks; fix them in the source and refresh.
Slicers and timelines
PivotTable Analyze > Insert Slicer adds buttons for a field, such as class period or category, that filter the table with one click. Insert Timeline does the same for dates with a draggable bar. In a team meeting, "what about just 3rd period?" gets answered faster with a slicer than with the Filters area.
PivotCharts
Select a cell in the pivot and choose PivotTable Analyze > PivotChart. The chart is tied to the pivot, so changing fields or clicking a slicer updates both. Clustered columns or lines suit monthly averages by class period; for share, a 100% stacked column stays readable with more categories than a pie. Hide the field buttons on the chart under PivotChart Analyze > Field Buttons.
Refresh and change the data source
Pivot tables traditionally don't recalculate when the source changes. In July 2025 Microsoft announced PivotTable Auto Refresh, rolling out gradually in Microsoft 365. Where it's available, it is on by default for new pivots and toggled from the PivotTable Analyze tab. It works only with data inside the same workbook, not with external sources like Power Query or databases.
Otherwise, refresh manually: right-click inside the pivot and choose Refresh, or use PivotTable Analyze > Refresh > Refresh All (Ctrl+Alt+F5) for every pivot in the workbook. To refresh whenever the file opens, turn on Refresh data when opening the file under PivotTable Options > Data.
If rows were added outside the original range, refreshing isn't enough. Use PivotTable Analyze > Change Data Source to reset the range.

👉 How to Create a Table in Excel: Ctrl+T, Totals, References
Worked example: averages by category and month from a gradebook export
An eighth-grade math teacher who runs her team's data meetings pulls a year-to-date export from the gradebook, Grade8_Math_Scores.xlsx. It has seven columns, Due Date, Student, Period, Category, Assignment, Score and Status, with about 4,800 rows from August through October: 120 students times 40 assignments. The team wants two things: the average score in each category (homework, quizzes, tests) by month, and the ten assignments with the lowest averages so they can plan reteaching.
Step 1: check the source. The status bar showed a different Count and Numerical Count for the Score column: 23 cells were numbers stored as text, and a few others said "EX" for excused work. She converted the text numbers, cleared the "EX" cells (the Status column already records them as excused, and Average skips blanks) and fixed a handful of due dates typed as "10.03.2026". Then she made the data a table named Scores.
Step 2: build the category-by-month pivot. On a new sheet: Category in Rows, Due Date in Columns, Score in Values. Excel summed the scores, which means nothing for grades, so Value Field Settings changed it to Average with one decimal place. Excel also grouped the dates by year and quarter, so a right-click on the column header and Group set it to months only.
Step 3: build the lowest-assignment pivot. A second pivot from the same table put Assignment in Rows and Score in Values twice: once as Average, once as Count to show how many scores were entered. From the Assignment arrow, Value Filters > Top 10, switched to Bottom 10 by Average of Score, kept the ten weakest assignments. Six of them came from the same unit on linear equations, which became the first agenda item.
Step 4: connect a slicer. A Period slicer was linked to both pivots through Report Connections. When a colleague asked whether 6th period was dragging the averages down, one click answered it.
Step 5: next month. November rows go at the bottom of the table and Refresh All updates both pivots. Because the source is a table, nobody has to change the data source before the next meeting.
When a pivot table looks wrong
It shows Count instead of Sum or Average. Microsoft notes that if Excel interprets the data as text, values are displayed as a COUNT. One text value or many blanks in the column is enough. Fix the source, then change the field back in Value Field Settings.
Totals don't match the source. The pivot hasn't been refreshed, or the source range doesn't include the new rows. Refresh first; if it still differs, check Change Data Source.
"The PivotTable field name is not valid." A header cell is empty or merged. Give every column a header and unmerge.
Clicking a pivot cell writes GETPIVOTDATA. That's Excel's default when a formula references a pivot. Turn it off from the arrow next to PivotTable Analyze > Options by unchecking Generate GetPivotData.
Column widths jump on every refresh. In PivotTable Options > Layout & Format, clear Autofit column widths on update.
Differences between Excel versions
The Windows versions of Microsoft 365, Excel 2024, 2021 and 2019 share the same menus. Excel for Mac builds pivots from Insert > PivotTable with the same field pane. Excel for the web creates and edits pivots too, choosing the destination in a side pane. Microsoft 365 also offers the PIVOTBY function and GROUPBY, which build pivot-style summaries as formulas that recalculate the moment the source changes.
FAQ
Q. Can one pivot table use data from several sheets?
Yes. Make each sheet a table, check Add this data to the Data Model when creating the pivot, and define relationships between the tables. If the sheets share the same columns, such as one sheet per class period, appending them into one table with a Period column is simpler.
Q. How do I turn a pivot into a static table?
Copy the whole pivot and use Paste Special > Values. The result won't refresh, so use it only for the version you share.
Q. How do I delete a pivot table?
Select the entire pivot and press Delete. If it sits alone on a sheet, delete the sheet. Nearby data and charts aren't affected.
Q. Can I add a calculated column?
Yes. PivotTable Analyze > Fields, Items & Sets > Calculated Field lets you write a formula like =Points/Possible in a score log that has both columns. Calculated fields work on the summed values, which is right for ratios such as total points earned over total points possible.
inline AI for data meeting summaries
With the gradebook export open on your PC, you ask inline AI for "average score by category and month, and the ten assignments with the lowest average, with a period slicer." inline AI fixes text numbers and dates first, then builds both pivots and a shared slicer, so the prep for the next data meeting is a refresh rather than an evening.
Gradebooks and spreadsheets, finished by inline AI in the file itself.
Ask in one sentence for roll-ups, trackers and the cleanup you repeat every week. Your files never leave your computer.




