How to create a Pivot Table in Excel (step by step, with examples)
A PivotTable turns thousands of rows into a report in a few clicks: totals, counts and percentages by region, month or manager — no formulas.
Example
Formula:
=SUMIFS(C2:C6,A2:A6,"Tashkent")→ result: 225000
What a PivotTable is and when to use it
A PivotTable builds a report from raw data without formulas. You only choose which column becomes rows and which one gets added up — Excel does the rest. In the example, drag Region to Rows and Amount to Values and the pivot shows one row per region: Tashkent — 225,000, Samarkand — 80,000, Bukhara — 70,000. That is the same result as the =SUMIFS(C2:C6,A2:A6,"Tashkent") formula above — think of a PivotTable as writing those SUMIFS for every region instantly. When to use it: sales reports, stock movement, expense analysis, monthly and quarterly summaries — any question of the form “what is the total by …”.
Creating a PivotTable step by step
1. Prepare the data: headers in the first row, no blank rows or merged cells, one type of data per column. 2. Click any cell and press Ctrl+T to turn the data into a table. New rows will then flow into the pivot automatically. 3. Insert → PivotTable. From the keyboard: Alt → N → V (in Excel 365 then T — From Table/Range). 4. Check the source range (or table name), keep New Worksheet and click OK. 5. The PivotTable Fields pane opens on the right — drag fields into the areas you need. Not sure where to start? Insert → Recommended PivotTables shows ready-made layouts.
The four areas: Rows, Columns, Values, Filters
• Rows — the report rows: region, product, manager. • Columns — usually month, year or category. You get a two-way table such as region × month. • Values — what gets calculated: amount, quantity. Numbers are summed by default. • Filters — a filter for the whole report: for example, only one branch or one year. Put two fields in Rows (Region, then Manager) and each region is broken down by manager. Drag fields around to change their order.
Count instead of Sum: changing the calculation
If the column you put in Values contains blank cells or text (such as “—” or numbers stored as text), Excel picks Count instead of Sum. Fix it by cleaning the data (fill blanks with 0, convert text to numbers) or by changing the calculation manually. Click the field in Values → Value Field Settings → Summarize Values By: Sum, Count, Average, Max, Min. Use the Number Format button in the same dialog to apply a thousands-separator format to the whole field — more reliable than formatting cells, because it survives a refresh.
Shares and percentages: Show Values As
Value Field Settings → Show Values As lets you display the total differently: • % of Grand Total — each region’s share of total sales. • % of Column Total / % of Row Total — share within a column or row. • Running Total In — a cumulative total, e.g. month by month. • Difference From / % Difference From — change versus the previous month. Tip: drag Amount into Values twice — keep one as a sum and switch the other to % of Grand Total. The number and its share sit side by side.
Grouping dates by month, quarter and year
In Excel 2016 and later, a date field dropped into Rows or Columns is often grouped automatically into Years, Quarters and Months. To do it manually: right-click any date in the pivot → Group → select Months, Quarters, Years → OK. The error “Cannot group that selection” means the date column contains text dates or blank cells. Convert them to real dates, remove blank rows and refresh the pivot. You can group numbers too: ages into 10-year bands or amounts into steps of 100,000.
Refresh, Slicers and Timelines
A PivotTable does not update by itself when the source data changes. Refresh: right-click inside the pivot → Refresh, or Alt+F5. Refresh every pivot in the workbook with Ctrl+Alt+F5 (Data → Refresh All). To refresh on open: PivotTable Options → Data → “Refresh data when opening the file”. A Slicer shows a filter as clickable buttons: PivotTable Analyze → Insert Slicer. A Timeline is a filter made for dates — pick a month, quarter or year with a slider. Connect one Slicer to several pivots via Report Connections and you have a simple dashboard.
Common errors and GETPIVOTDATA
• “The PivotTable field name is not valid” — the source has a column with an empty header or merged header cells. Give every column a name. • New rows don’t appear — the source is a plain range (A1:C100). Convert it to a table (Ctrl+T) or extend it via PivotTable Analyze → Change Data Source. • Stale results — the pivot wasn’t refreshed (Alt+F5). • You can’t type formulas inside a pivot: add the column to the source, or use Fields, Items & Sets → Calculated Field. If you click a pivot cell while writing a formula, Excel inserts GETPIVOTDATA instead of a plain reference. It keeps returning the right value even when the pivot layout changes. To get plain references: PivotTable Analyze → arrow next to Options → untick Generate GetPivotData.
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.