How to Make a Pivot Table in Excel (Windows, Mac and Web)

To make a pivot table in Excel, click any cell in your data, go to Insert > PivotTable, choose New Worksheet, and click OK. Excel opens a blank pivot table with a PivotTable Fields pane on the right. Tick or drag a text field (such as Region) into Rows and a number field (such as Sales) into Values, and the summary builds itself.

These steps are written for Excel for Microsoft 365 on Windows, and they match Excel 2024, 2021, 2019 and 2016 closely. Excel for Mac and Excel for the web use the same idea with a few different button names, and those paths are covered in their own sections further down.

Get your data ready first

A pivot table is only as tidy as the list it reads from. Most of the problems beginners run into (missing rows, totals that show as a count, a field you can’t find) come from the source data, so a two-minute check here saves time later. Repeated rows inflate the totals, so remove duplicates in Excel before you build it if your list might contain them.

  • One header row. Every column needs a short, unique name in the first row. Those names become the field names in the pivot table. Avoid blank headers, two stacked header rows and merged cells.
  • One kind of data per column. A Sales column should hold only numbers. A single “N/A” typed into it can make Excel treat the whole field as text.
  • No blank rows or columns in the middle. Excel guesses the range by looking for the edges of your data, and a gap makes it stop early.
  • No subtotal or total rows. The pivot table calculates its own totals. Leaving yours in counts the same sales twice.
  • Records go down, not across. Each row should be one sale, one order or one entry. If months are spread across columns (Jan, Feb, Mar), the data needs reshaping before it pivots well.

It also helps to turn the list into an Excel table: click inside it, press Ctrl+T, confirm that My table has headers is ticked, and click OK. A pivot table built from a table picks up new rows automatically the next time you refresh it, instead of needing its range changed by hand.

The examples below use this small sales list, which starts in cell A1:

Advertisements
Date Region Product Units Sales
1/8/2026 East Desk 3 $900
1/15/2026 West Chair 10 $1,200
1/22/2026 East Chair 6 $720
2/5/2026 West Desk 2 $600
2/12/2026 East Lamp 8 $320
2/26/2026 West Lamp 5 $200

Build a pivot table step by step (Windows)

  1. Click one cell inside your data. Any cell works. You don’t need to select the whole list, because Excel detects the range for you.
  2. Open the Insert tab and click PivotTable. It’s the first button on the left of the ribbon, in the Tables group. In Microsoft 365, clicking the top half of the button goes straight to the dialog. Clicking the small arrow under it shows a menu; choose From Table/Range for ordinary worksheet data.
  3. Check the range in the dialog. The dialog is titled PivotTable from table or range in Microsoft 365 and Create PivotTable in older versions. The Table/Range box should show your whole list, such as Sheet1!$A$1:$E$7, or a table name such as Table1. If it’s wrong, click in the box and drag over the correct cells, including the header row.
  4. Choose where the pivot table goes. Leave New Worksheet selected to put it on a fresh sheet, which is the easiest place to work. Pick Existing Worksheet and click a cell in the Location box if you want it beside your data; leave enough empty space, because the pivot table grows as you add fields.
  5. Leave “Add this data to the Data Model” unticked unless you need to combine several related tables or use the Distinct Count calculation. For a single list, the normal setting is simpler.
  6. Click OK. Excel adds a new sheet with an empty pivot table placeholder on the left and the PivotTable Fields pane on the right. Two extra ribbon tabs, PivotTable Analyze and Design, appear whenever a cell in the pivot table is selected.
  7. Add a field to Rows. In the field list at the top of the pane, tick Region, or drag it down into the Rows box. East and West appear as row labels.
  8. Add a field to Values. Tick Sales, or drag it into Values. Excel adds a Sum of Sales column and a Grand Total row.
  9. Add a second breakdown (optional). Drag Product into Columns to get a grid of regions by product. Drag it into Rows below Region instead to nest products under each region.

With Region in Rows, Product in Columns and Sales in Values, the sample list produces this summary:

Sum of Sales Chair Desk Lamp Grand Total
East 720 900 320 1,940
West 1,200 600 200 2,000
Grand Total 1,920 1,500 520 3,940

When you tick a box instead of dragging, Excel chooses the area for you: text fields go to Rows, number fields go to Values, and date and time hierarchies go to Columns. You can drag any field to a different box afterward.

Nothing you do in the pivot table changes your original data. You can rearrange, add and remove fields as often as you like.

What Rows, Columns, Values and Filters do

The bottom half of the PivotTable Fields pane has four boxes. The field list above them is every column header from your data.

Area What it does Good fields for it
Rows Lists each unique item down the left side. Region, Product, Customer, Salesperson
Columns Lists each unique item across the top, creating a grid. Month, Quarter, a short category list
Values Calculates numbers for every row and column pair. Sales, Units, Hours, Cost
Filters Adds a drop-down above the table that limits what the whole report shows. Year, Store, Department

To take a field out, drag it from its box back to the field list, untick it, or click the arrow next to it in the box and choose Remove Field. If the pane disappears, click any cell in the pivot table. If it still doesn’t show, go to PivotTable Analyze > Field List.

Change the math, sort, group and format

Switch from Sum to Count, Average and more

Number fields start as a Sum. Fields Excel reads as text, including number columns with blanks or stray text, start as a Count.

  1. Right-click any number in the value column.
  2. Point to Summarize Values By and choose Sum, Count, Average, Max, Min or Product. For more options, choose More Options, which opens Value Field Settings.
  3. The column heading updates, for example from Sum of Sales to Average of Sales. You can type a shorter name in Custom Name in the same dialog.

Show percentages instead of totals

Right-click a value, point to Show Values As, and pick % of Grand Total, % of Column Total or % of Row Total. In the sample, West’s chair sales would show as 30.46% of the grand total (1,200 ÷ 3,940). To see dollars and percentages side by side, drag Sales into Values a second time and change only the second copy.

Sort the results

Right-click a number in the column you want to rank by, point to Sort, and choose Sort Largest to Smallest or Sort Smallest to Largest. To sort the labels alphabetically, use the arrow next to Row Labels.

Group dates into months, quarters or years

Microsoft 365 often groups a date field automatically when you add it, showing Years, Quarters and Months. To set it yourself, right-click a date in the pivot table, choose Group, select one or more options under By (for example Months and Years), and click OK. Choosing Months alone combines January of every year into one row, so add Years when your data spans more than one year. Right-click and choose Ungroup to go back to individual dates. If Group is greyed out, at least one cell in that date column is blank or holds text instead of a real date.

Format the numbers

Formatting cells directly in a pivot table can be lost when the layout changes. Format the whole field instead: right-click a value, choose Number Format, pick Currency or Number, set the decimal places, and click OK. To change the overall look, select a cell in the pivot table and pick a style from the Design tab.

Filter with a click

Use the arrow beside Row Labels or Column Labels to hide items, or drag a field into Filters to get a report-wide drop-down. For buttons that anyone can click, go to PivotTable Analyze > Insert Slicer and choose a field.

If you’re not sure what to drag where, Excel on Windows can propose ready-made summaries.

  1. Click a cell in your data.
  2. Go to Insert > Recommended PivotTables.
  3. Click each suggestion on the left to preview it on the right.
  4. Click OK on the one closest to what you want. Excel builds it on a new sheet, and you can still change its fields.

In Microsoft 365, recommendations are part of Microsoft’s connected experiences. If those are turned off in your privacy settings or by your organization, recommendations won’t be offered and you’ll need to build the table yourself with the steps above.

Excel for Mac and Excel for the web

Excel for Mac

  1. Click a cell in your data.
  2. On the Insert tab, click PivotTable.
  3. In the dialog that opens, confirm the range, choose whether the pivot table goes on a new sheet or an existing one, and click OK.
  4. Drag fields into the Filters, Columns, Rows and Values boxes in the PivotTable Fields pane, exactly as on Windows.

If the field pane closes on a Mac, click inside the pivot table and choose PivotTable Analyze > Field List. To change Sum to Count or Average, right-click a number in the value column and choose the value field settings option, just as you would on Windows. On a Mac without a right mouse button, hold Control and click.

Excel for the web

  1. Open the workbook in your browser and click a cell in the data.
  2. Go to Insert > PivotTable. A pane opens on the right.
  3. Pick a suggested layout, or choose the option to create your own, then choose a new sheet or an existing one.
  4. Use the PivotTable Fields pane to drag fields into the four areas.

The web version has no separate Design tab. With a pivot table cell selected, use the PivotTable tab on the ribbon, and click Settings to change the report layout, totals and other options.

Keep the numbers up to date

A pivot table works from a saved snapshot of your data. If you change a number, add a row or fix a typo in the source, the pivot table in desktop Excel keeps showing the old figures until you refresh it.

  • Right-click anywhere in the pivot table and choose Refresh, or press Alt+F5.
  • To update every pivot table in the file, go to PivotTable Analyze, click the arrow under Refresh, and choose Refresh All.
  • To refresh every time the file opens, go to PivotTable Analyze > Options, open the Data tab, and tick Refresh data when opening the file.

Refreshing picks up new rows only if they fall inside the pivot table’s source. If your source is a plain range, rows added below it are left out. Fix that with PivotTable Analyze > Change Data Source and select the larger range, or convert the source to a table so it expands on its own.

If refreshing changes your column widths, open PivotTable Analyze > Options, go to Layout & Format, and untick Autofit column widths on update.

When something looks wrong

  • Your totals say “Count of Sales” instead of “Sum of Sales.” The column contains blanks or text. Clean the source column so it holds only numbers, refresh, then switch the field back to Sum with Summarize Values By.
  • Some rows are missing. The range stopped at a blank row, or new rows were added below the original range. Use Change Data Source to include them.
  • A field shows “(blank)”. Some source rows have an empty cell in that column. Fill them in or filter “(blank)” out with the Row Labels arrow.
  • The PivotTable button is greyed out. The sheet may be protected, you may be editing a cell (press Esc), or the file may be open in Protected View or as read-only. Click Enable Editing if that bar appears.
  • “The PivotTable field name is not valid.” At least one column in the source has an empty header. Give every column a name and try again.
  • “A PivotTable report cannot overlap another PivotTable report.” Two pivot tables on the same sheet have grown into each other. Move one with PivotTable Analyze > Move PivotTable, or put each on its own sheet.
  • The pivot table is read-only with a message about features not being compatible. The file uses pivot table features your version of Excel doesn’t support. Open it in Excel for the web or update Microsoft 365.

Pivot table questions people ask

How do I delete a pivot table?

Click a cell in it, go to PivotTable Analyze > Select > Entire PivotTable, and press Delete. If it’s alone on its own sheet, you can right-click the sheet tab and choose Delete instead. Your source data isn’t affected.

Can I make a chart from a pivot table?

Yes. Click a cell in the pivot table and choose Insert > PivotChart, pick a chart type, and click OK. The chart stays linked, so filtering the pivot table filters the chart too. A few chart types, such as scatter, bubble and stock charts, can’t be used as pivot charts.

Is there a keyboard shortcut to insert a pivot table?

On Windows, press Alt, then N, V, T one key at a time to open the dialog in Microsoft 365, then press Enter to accept the defaults. Older versions use Alt, N, V.

Why doesn’t my pivot table update when I type new numbers?

Desktop pivot tables don’t recalculate like formulas do. Right-click the pivot table and choose Refresh after any change to the source data.

Can I build one pivot table from two sheets?

Yes, if the sheets share a common column such as an order or customer ID. Format each list as a table, tick Add this data to the Data Model when you create the pivot table, then create a relationship between the tables when Excel prompts you. For simple cases, it’s often easier to combine the lists into one table first.

Does a pivot table work in Google Sheets the same way?

The idea is the same, with rows, columns, values and filters, but the menus differ. If you use both apps, the steps for sorting a pivot table in Google Sheets show how its editor panel compares.

Where to go from here

Once your first summary works, try the same data with different fields in Rows and Columns. That’s the “pivot” in pivot table, and it’s often how you spot a trend. If you only need one quick total rather than a full breakdown, a formula may be faster, and the guide to adding up a column in Excel covers that. To make high and low values stand out in your finished report, you can also set up a conditional formatting rule on the value cells.

Microsoft’s own page on creating a PivotTable to analyze worksheet data covers extra sources such as the Data Model and Power BI, and its guides to refreshing PivotTable data and grouping data in a PivotTable go deeper into those two settings.

Advertisements