Back to Blog

How to Create a Pivot Table in Google Sheets: 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 Google Sheets, 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: Google Sheets will automatically detect your data range if you click any cell within it.

Step 3: Insert Pivot Table

  1. Click Data in the menu bar
  2. Click Pivot table
  3. A new sheet will be created with an empty pivot table
  4. The Pivot table editor will appear on the right

Step 4: Build Your Pivot Table

In the Pivot table editor:

  1. Add rows: Click Add under Rows, then choose a field
  2. Add columns: Click Add under Columns, then choose a field
  3. Add values: Click Add under Values, then choose a field
  4. Add filters: Click Add under Filters, then choose a field

Example:

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

Step 5: Customize Value Calculations

To change how values are calculated:

  1. Click the field in the Values section
  2. Click the dropdown (shows "Sum" by default)
  3. Choose calculation type:
    • SUM: Add up values
    • COUNT: Count items
    • COUNTA: Count non-empty cells
    • AVERAGE: Calculate average
    • MAX/MIN: Find highest/lowest
    • CUSTOM: Use a formula
  4. The calculation updates automatically

Step 6: Format Your Pivot Table

  1. Click anywhere in the pivot table
  2. Use standard formatting tools:
    • FormatNumber → Choose format (currency, percentage, etc.)
    • FormatBold/Italic → Style text
    • FormatFill color → Color cells

Step 7: Refresh Data

When your source data changes:

  1. Click anywhere in the pivot table
  2. Click the Refresh icon (circular arrow) in the Pivot table editor
  3. Or right-click the pivot table → Refresh

Common Pivot Table Examples

Total Sales by Region

  1. Create pivot table
  2. Add "Region" to Rows
  3. Add "Sales" to Values (set to SUM)
  4. Result: Shows total sales for each region

Sales by Product and Month

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

Count of Transactions

  1. Create pivot table
  2. Add "Product" to Rows
  3. Add "Transaction ID" to Values (set to COUNT)
  4. Result: Shows number of transactions per product

Grouping Data

To group dates:

  1. Add a date field to Rows or Columns
  2. Click the field in the pivot table editor
  3. Click Group by → Choose grouping (Month, Quarter, Year)
  4. The dates will be grouped automatically

Filtering Pivot Tables

To filter a pivot table:

  1. Add filters: Add fields to the Filters section
  2. Use filter dropdowns: Click the filter icon next to filter fields
  3. Row/Column filters: Click dropdown arrows in row/column headers

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
  • Format numbers: Format values as currency, percentage, etc. for readability
  • Use filters: Add filters to focus on specific data subsets
  • Group dates: Group dates by month/quarter/year for time-based analysis
  • 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. In the Pivot table editor, click the data range
  3. Select the new range
  4. The pivot table updates automatically

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. DataPivot table
  4. Create a second pivot table with different fields
  5. Both tables use the same source but show different summaries

Pivot Table vs Regular Formulas

Pivot Tables:

  • Quick to create
  • Easy to modify
  • Automatic grouping
  • Interactive filtering

Regular Formulas:

  • More control
  • Can reference specific cells
  • Better for one-time calculations

Use pivot tables for exploration and analysis, formulas for specific calculations.

Conclusion

Now you know how to create pivot tables in Google Sheets 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