← Guides

Excel Pivot Tables Step by Step: From Raw Sales Data to a Monthly Report

Build a clean monthly sales report with a pivot table, avoid the five classic data-source mistakes, and know when a formula is the better choice.

Excel · 8 min read

By the FormulAI editorial team · Reviewed October 2026

Prepare the source data first

A pivot table is only as reliable as its source. Your data must be a flat list: one header row, one record per row, no merged cells, no blank rows and no subtotal lines in the middle. Convert the range into a Table (Ctrl+T) so that new rows are picked up automatically when you click Refresh. Most "wrong totals" reported by users come from a source range that was never extended after new data was pasted.

Create the pivot table

Select any cell of the Table, then Insert > PivotTable > New worksheet. Drag Date into Rows, Sales rep into Columns and Amount into Values. Excel groups dates by year, quarter and month automatically on recent versions; right-click a date and choose Group if it does not. Change the value field to Sum (not Count): a Count usually means some amounts are stored as text.

Fix amounts stored as text

Imported CSV files often contain amounts like "1 250,00" with a non-breaking space. Excel treats them as text and the pivot table counts them instead of summing. Clean them in a helper column, then point the pivot table to that column.

=VALUE(SUBSTITUTE(SUBSTITUTE(C2;CHAR(160);"");" ";""))

Make the report readable

Apply a number format to the value field (Value Field Settings > Number Format) instead of formatting cells, otherwise the format is lost on refresh. Add a Slicer on Region so managers can filter without touching the layout, and use Show Values As > % of Column Total to compare reps fairly when territories have different sizes.

Pivot table or formula?

Use a pivot table for exploration and recurring reports with many dimensions. Use SUMIFS or the GROUPBY / PIVOTBY functions (Microsoft 365) when the result must feed other formulas, because pivot table cells move when the layout changes. If you need a GETPIVOTDATA formula to reference a pivot, that is a sign a SUMIFS would be more robust. FormulAI can generate either: describe your columns and the report you want.

How this guide was made

Every formula, query and script in this guide was run on a real sample file (Excel 365, Google Sheets, PostgreSQL, MySQL or Python 3) before publication. We document the edge cases we hit during testing, such as text-formatted numbers, empty months or NULL values. AI helps us draft and translate; a human checks each example and updates the guide when software versions change. Spotted an error? Write to contact@formulai-app.com.