Back to Blog

How to Create a Pivot Table in Excel: Step-by-Step Guide | SheetXAI

D
David DeSouza
Dec 1, 2025
Vector illustration showing two people interacting with a calendar interface, representing summarizing and analyzing large datasets with interactive pivot tables

The Problem

You have a large dataset with many rows and columns (like sales data with products, dates, regions, and amounts) and need to summarize it - for example, total sales by region, average sales by product, or count of transactions by month. Pivot tables let you quickly analyze and summarize data without writing complex formulas.

The Easy Way: Use SheetXAI

If you don't want to manually create pivot tables, the fastest way is to simply ask SheetXAI.

With SheetXAI, you can open the sidebar and type:

Create a pivot table showing total sales by region and product.

SheetXAI will instantly create the pivot table for you, automatically organizing the data and calculating summaries. It handles all the field placement and calculations so you can focus on insights.

The Manual Way: Step-by-Step Instructions

To create a pivot table manually in Excel, follow these steps:

Step 1: Prepare Your Data

Your data should be:

  • Organized in columns: Each column should have a header
  • No blank rows or columns: Remove any empty rows/columns within your data
  • Consistent data types: Each column should contain the same type of data
  • No subtotals: Remove any existing subtotals or summary rows

Example structure:

Date | Product | Region | Sales
2024-01-01 | Product A | North | 1000
2024-01-02 | Product B | South | 1500

Step 2: Select Your Data

  1. Click on any cell within your data range
  2. Or select the entire range: Click and drag to select all your data
  3. Make sure to include the header row

Tip: Excel will automatically detect your data range if you click any cell within it.

Step 3: Insert Pivot Table

  1. Click the Insert tab in the ribbon
  2. Click PivotTable in the Tables group
  3. The Create PivotTable dialog will appear

Step 4: Configure Pivot Table Settings

In the Create PivotTable dialog:

  1. Table/Range: Verify the data range is correct (or select a different range)
  2. Choose where to place the pivot table:
    • New Worksheet: Creates pivot table in a new sheet (recommended)
    • Existing Worksheet: Place it in the current sheet (choose location)
  3. Click OK

Step 5: Build Your Pivot Table

The PivotTable Fields pane will appear on the right:

  1. Drag fields to areas:
    • Filters: Fields to filter the entire pivot table
    • Columns: Fields to create column headers
    • Rows: Fields to create row labels
    • Values: Fields to calculate (sums, counts, averages)

Example:

  • Drag "Region" to Rows
  • Drag "Product" to Columns
  • Drag "Sales" to Values

Step 6: Customize Value Calculations

To change how values are calculated:

  1. Click the field in the Values area
  2. Click Value Field Settings
  3. Choose calculation type:
    • Sum: Add up values
    • Count: Count items
    • Average: Calculate average
    • Max/Min: Find highest/lowest
    • Product: Multiply values
  4. Click OK

Step 7: Format Your Pivot Table

  1. Click anywhere in the pivot table
  2. The PivotTable Analyze and Design tabs appear
  3. Use Design tab to:
    • Choose a pivot table style
    • Show/hide grand totals
    • Show/hide subtotals
    • Change layout (compact, outline, tabular)

Step 8: Refresh Data

When your source data changes:

  1. Click anywhere in the pivot table
  2. Click PivotTable AnalyzeRefresh
  3. Or right-click → Refresh

Keyboard shortcut: Alt+F5

Common Pivot Table Examples

Total Sales by Region

  1. Create pivot table
  2. Drag "Region" to Rows
  3. Drag "Sales" to Values
  4. Result: Shows total sales for each region

Sales by Product and Month

  1. Create pivot table
  2. Drag "Product" to Rows
  3. Drag "Date" to Columns (group by month)
  4. Drag "Sales" to Values
  5. Result: Shows sales for each product by month

Count of Transactions

  1. Create pivot table
  2. Drag "Product" to Rows
  3. Drag "Transaction ID" to Values
  4. Change calculation to Count
  5. Result: Shows number of transactions per product

Grouping Data

To group dates or numbers:

  1. Right-click on a date/number in the pivot table
  2. Select Group
  3. Choose grouping:
    • Dates: By months, quarters, years
    • Numbers: By ranges (e.g., 0-100, 100-200)
  4. Click OK

Filtering Pivot Tables

To filter a pivot table:

  1. Row/Column filters: Click the dropdown arrow in row/column headers
  2. Report filter: Use fields in the Filters area
  3. Slicers: Add slicers for visual filtering:
    • Click PivotTable AnalyzeInsert Slicer
    • Choose fields to create slicers
    • Click slicer buttons to filter

Common Mistakes to Avoid

  1. Blank rows/columns in data: Remove empty rows/columns before creating pivot table
  2. Including totals in source data: Don't include summary rows in your source data
  3. Not refreshing: Remember to refresh when source data changes
  4. Wrong field placement: Make sure fields are in the right areas (rows vs columns)
  5. Too many fields: Don't add too many fields - keep it simple and focused

Tips for Better Pivot Tables

  • Start simple: Begin with one row field and one value field, then add more
  • Use slicers: Slicers make filtering easier and more visual
  • Format numbers: Right-click values → Number Format to format as currency, percentage, etc.
  • Use calculated fields: Add custom calculations in PivotTable AnalyzeFields, Items & SetsCalculated Field
  • Use SheetXAI for complex tables: For complex pivot table setups, SheetXAI can create them automatically

Updating Pivot Table Source Data

If your source data range changes:

  1. Click the pivot table
  2. Click PivotTable AnalyzeChange Data Source
  3. Select the new range
  4. Click OK

Creating Multiple Pivot Tables

You can create multiple pivot tables from the same source data:

  1. Create your first pivot table
  2. Click on source data
  3. InsertPivotTable
  4. Create a second pivot table with different fields
  5. Both tables use the same source but show different summaries

Conclusion

Now you know how to create pivot tables in Excel manually. They're powerful tools for analyzing and summarizing large datasets.

But for those times when you need to create complex pivot tables or analyze data quickly, SheetXAI can generate pivot tables automatically with simple commands, saving you time and ensuring accurate analysis.

Boost your productivity today.
Start automating your spreadsheets.

Join thousands of professionals saving hours every week. No credit card required to start.

Learn more