Google Sheets Tips

Pivot tables in Google Sheets: how to create, customize and use them

A pivot table turns a long list of rows into a summary by category. This guide shows how to create one in Google Sheets, then how to add calculated fields, group dates by month, filter with slicers, combine data from several tabs, format the result and fix the problems that come up.

Google Sheets TipsVadym Kramarenko20 min read

Pivot tables in Google Sheets: how to create, customize and use them

To create a pivot table in Google Sheets, select your data, go to Insert → Pivot table, choose where to put it and click Create. Then, in the editor on the right, add a field to Rows, optionally one to Columns, and a number field to Values. The table summarizes the numbers for every combination of the categories you chose.

This guide walks through those steps with screenshots, then covers calculated fields, grouping dates by month, filters and slicers, sorting, data from several tabs, formatting, and the problems people run into.

Note: Originally published in July 2024. Fully updated in October 2026: corrected how pivot tables refresh in Google Sheets (they update by themselves), the spreadsheet size limit and the calculated field example, and removed advice that applied to Excel.

What is a pivot table?

What is a pivot table?

A pivot table is a summary of a larger table. You choose one or two columns to group by and a number to aggregate, and Google Sheets builds the summary: totals by product, averages by region, counts by month. The source data is not changed, and the same data can feed any number of pivot tables.

Imagine you have a spreadsheet tracking sales data. Each row represents a sale, detailing the sales rep, product sold, and units sold.

Google Sheets table showing sales data, used as the base dataset for creating a pivot table.

As a list, the data shows single sales and hides the totals. A pivot table shows the total units each rep sold of each product:

A completed pivot table summarizing units sold by Sales Rep and Product, with grand totals for both rows and columns displayed.

The same summary could be built with SUMIFS formulas. A pivot table gets there without formulas, and can be rearranged in a few clicks when the question changes.

How to create a pivot table in Google Sheets

How to create a pivot table in Google Sheets

Step 1: Select the data

Select the range you want to analyze. Each column needs a header in the first row, and there should be no empty rows inside the data.

Suppose your data is spread across cells B2 to E17, with “Date” in column B, “Sales Rep” in column C, “Product” in column D, and “Units Sold” in column E. In this case, you would highlight the range from B2 to E17 to include all relevant data.

A sales dataset in Google Sheets showing daily product sales with columns for Date, Sales Rep, Product, and Units Sold..

Step 2: Insert the pivot table

In the menu, choose Insert → Pivot table.

Google Sheets menu with the Insert tab open and Pivot table option highlighted, showing how to start creating a pivot table.

A dialog asks whether to put the pivot table on a new sheet or on an existing sheet. This example uses the existing sheet, starting at cell G2.

A pop-up window in Google Sheets showing the ‘Create pivot table’ dialog with options to insert the pivot table into a new or existing sheet.

Click Create. An empty pivot table appears, with the pivot table editor on the right:

A partially filled pivot table in Google Sheets.

Step 3: Add rows, columns and values

The editor has four sections. Click Add next to a section and pick a field.

1. Rows and columns. Add Product to Rows: every product gets a row. Add Sales Rep to Columns: every rep gets a column.

A blank pivot table layout in Google Sheets with columns, rows, and values sections, ready for configuration using the Pivot Table Editor.

2. Values. Add Units Sold to Values. Google Sheets sums the units for each product and rep, and adds grand totals.

Google Sheets may also offer ready-made pivot tables under Suggested at the top of the editor. They are a quick start when the data is simple.

The Turning Point

OWOX Data Marts

See your first report built in real time. 15 minutes.

  1. Connect your data warehouse
  2. Pick your metrics
  3. Get a live Google Sheets report

In the time it takes to write a ticket. Then imagine never writing that ticket again.

Book a Demo

We'll use your actual use case

The parts of a pivot table

The parts of a pivot table

  • Rows: the field whose values run down the left side. One row per distinct value.
  • Columns: the field whose values run across the top. One column per distinct value. Optional.
  • Values: the numbers in the middle, and how they are aggregated: SUM, AVERAGE, COUNT, MAX, MIN and others.
  • Filters: conditions that decide which rows of the source data are included.
  • Totals: the grand total row and column, which can be switched off per field with Show totals.

Customizing a pivot table

Customizing a pivot table

Adding multiple value fields for diverse data views

A pivot table can show several values side by side. Suppose you have a marketing dataset with columns for:

  • “Campaign Type”
  • “Clicks”
  • “Conversions”
  • “Cost”

A campaign performance dataset in Google Sheets listing Campaign Type, Clicks, and Conversions for multiple entries.

To see clicks and conversions for each campaign type:

  1. Select your dataset.
  2. Create a pivot table.
  3. Add “Campaign Type” to Rows.
  4. Add “Clicks” and “Conversions” as Value fields.
  5. Customize aggregation types (e.g., sum, average) for each value field.

A pivot table summarizing campaign data with total clicks and average conversions by campaign type, showing metrics like SUM of Clicks and AVERAGE of Conversions.

Each value keeps its own aggregation, so one column can be a sum and the next an average.

Changing aggregation types to enhance data interpretation

Every field in Values has a Summarize by setting: SUM, AVERAGE, COUNT, MAX, MIN and more. Take a month of daily website traffic data.

A dataset in Google Sheets showing daily visitor analytics.

Each row represents a day, and columns include metrics like “Visitors,” “Pageviews,” and “Conversion Rate.”

Here are the steps:

  1. Data Selection: Choose the dataset with your website traffic data.
  2. Pivot Table Creation: Create a pivot table with “Date” as rows and “Visitors,” “Pageviews,” and “Conversion” as values.
  3. Aggregation types: Open the Summarize by drop-down of each field under Values and choose the aggregation.

A pivot table summarizing visitor data by date with SUM, AVERAGE, and COUNT, along with the Pivot Table Editor setup on the right.

Here we have used:

  • Sum of Visitors: This reveals the total number of visitors for each day.
  • Average Pageviews: Shows the average pageviews per day.
  • Count of Conversions: Indicates how many times conversions occurred each day.

A rate such as Conversion Rate should not be summed or averaged across rows of different size. Rebuild it from its parts with a calculated field, as shown below.

Implementing filters for targeted analysis

A filter limits the pivot table to part of the source data. Consider a dataset of website visitors. This dataset includes columns like date, traffic source (e.g., organic search, social media, paid ads), page views, and conversion rate.

Google Sheets dataset showing website traffic data by date and traffic source, including page views and conversion rate percentage.

To look at one traffic source only:

  1. Click any cell in the dataset and choose Insert → Pivot table.
  2. Add Date and Traffic Source to Rows, and Page Views to Values.
  3. Next to Filters, click Add and choose Traffic Source.
  4. Open the filter drop-down, click Clear, tick Social Media and click OK.

The pivot table now shows only the rows for social media traffic:

Pivot table grouped by Date and Traffic Source showing the SUM of Page Views and Conversion Rates with expandable row totals.

Pivot table features with examples

Pivot table features with examples

How pivot tables refresh

A pivot table in Google Sheets updates by itself when the data in its source range changes. There is no Refresh button to press. What it cannot do is notice rows added below the range it was built on.

Suppose a pivot table summarizes revenue by product and salesperson from the range B2:E17.

Dataset showing sales revenue by Date, Product, and Salesperson in Google Sheets, with multiple entries for each combination..

Pivot table showing total revenue and Product, with grand totals and the Pivot Table Editor configured for rows, columns, and values.

New sales are then added in rows 18 to 22:

A modified version of the previous sales dataset with new rows of data highlighted in yellow.

The pivot table does not change, because those rows are outside B2:E17. To include them:

  1. Click the pivot table to open the editor.
  2. At the top of the editor, change the data range from B2:E17 to B2:E22.

An updated pivot table showing refreshed totals, reflecting the changes from the newly added data rows.

To avoid doing this every time, give the pivot table an open-ended range from the start, as described under dynamic ranges below.

Calculated fields in pivot tables

A calculated field is a value that the pivot table computes from other fields. Take a table with the columns Product, Sales in Jan and Sales in Feb, where you want the total of both months.

A simple table in Google Sheets showing products (A–E) with columns for “Sales in Jan” and “Sales in Feb.”

1. Create the pivot table: select the data and choose Insert → Pivot table.

2. Set it up: add Product to Rows.

3. Add a Calculated Field:

  • In the editor, next to Values, click Add and choose Calculated field.

Pivot table in Google Sheets showing product names as rows, but no data values added yet.

  • Enter the formula. Field names that contain spaces go in single quotes:

='Sales in Jan'+'Sales in Feb'

Pivot table in Google Sheets displaying a calculated field that sums January and February sales for each product, along with a Grand Total.

The pivot table now shows the total of both months for each product.

For a ratio, such as a conversion rate, set Summarize by to Custom and aggregate inside the formula: =SUM(Conversions)/SUM(Clicks). This divides the totals, which is the correct rate for each row of the pivot table and for the grand total.

Sorting data in pivot tables

By default the rows of a pivot table are sorted by their labels, from A to Z. To rank them by a value instead, use the Sort by setting of the row field. Take a sales dataset with products, sales reps and amounts.

Original dataset showing sales reps, products, and sales amounts in Google Sheets.

In the editor, under the Product field in Rows, set Order to Descending and Sort by to SUM of Sales Amount. The best-selling products move to the top:

Pivot table in Google Sheets summarizing sales by product. Data is sorted in descending order of sales amount.

Editing and updating pivot tables

A pivot table can be rearranged at any time. Click it, and the editor opens again. Suppose a pivot table shows total sales by product category (Electronics, Clothing, Accessories).

Google Sheets with a dataset of product categories, regions, and total sales. A pivot table on the right shows total sales by product category.

To see sales by region instead, remove Product Category from Rows with the X next to it, and add Region.

Pivot table now shows total sales grouped by region instead of product category.

Grouping data by month and date in pivot tables

A date field in Rows gives one row per day. To summarize by month, quarter or year, group the dates. Take a year of daily website traffic.

1. Create a Pivot Table:

  • Select your dataset.
  • Choose Insert → Pivot table.

2. Set Up the Pivot Table:

  • In the pivot table editor, add “Date” to the Rows area.
  • Then, add “Website Visits” to the Values area, usually setting it to SUM to get the total visits per date or period.

Google Sheets showing a dataset of website visits by date. A pivot table on the right summarizes total visits per exact date.

3. Grouping by Month:

  • Right-click any date in the pivot table.
  • Choose Create pivot date group.
  • Select Month. If the data covers more than one year, select Year-Month instead, so that the same month of different years is not added together.

User right-clicks a date cell in the pivot table and selects the “Create pivot date group” option, choosing to group by “Month.’

4. Adjusting the Pivot Table:

  • After grouping, the pivot table will show a summary of website visits for each month.
  • You can adjust other settings, like sorting or filtering, based on your analysis needs.

Pivot table in Google Sheets showing website visits grouped by month names with the corresponding sum of visits.

The grouping only works on real dates. If the option is missing, the column contains dates stored as text.

Using data from multiple sheets in a pivot table

A pivot table reads one range. To analyze data that lives on several tabs, for example website visits, email click-through rates and social media engagement, combine it into one table first.

1. Prepare the Data:

  • Ensure each sheet (website visits, email click-through rates, social media engagement) has a common key for merging. Usually, this is the date or a unique campaign identifier.
  • Each sheet should be structured similarly, with the key column (like the date) in the same relative position.

2. Create a Master Sheet:

  • Create a new sheet to consolidate the data.
  • Use formulas like QUERY, VLOOKUP or ARRAYFORMULA to combine data from different sheets based on the common key.
  • This master sheet will have columns for all the metrics you want to analyze (e.g., date, website visits, email click-through rate, social media engagement).

Here, we have used the following method:

  • Use VLOOKUP to Pull Data: In the row below your headers, use the VLOOKUP function to pull data from each sheet. Assuming your date is in column B, and each sheet is named appropriately, your formulas in each cell might look like this:
    • C10: =VLOOKUP(B10, ‘Website Visits’!B:D, 2, FALSE) - for Website Visits.
    • D10: =VLOOKUP(B10, ‘Website Visits’!B:D, 3, FALSE) - for Conversions.
    • E10: =VLOOKUP(B10, ‘Email Click-Through Rate’!B:D, 2, FALSE) - for Emails Sent.
    • F10: =VLOOKUP(B10, ‘Email Click-Through Rate’!B:D, 3, FALSE) - for Click-Through Rate.
    • G10: =VLOOKUP(B10, ‘Social Media Engagement’!B:D, 2, FALSE) - for Social Media Posts.
    • H10: =VLOOKUP(B10, ‘Social Media Engagement’!B:D, 3, FALSE) - for Engagement Rate.
  • Drag the formulas down as far as you need to cover all your dates.

Consolidated marketing data table in Google Sheets.

3. Build the Pivot Table:

  • Select the consolidated data in the master sheet.
  • Choose Insert → Pivot table.
  • In the pivot table editor, arrange the fields as needed. For example, you might put the date as rows and the different metrics (website visits, click-through rates, engagement rates) as values.

Pivot table in Google Sheets summarizing click-through rate, website visits, and social media posts by date, using data from multiple sheets.

When the tabs have the same columns and you want the rows stacked instead of matched by date, combine them with curly braces and a semicolon, for example ={'January'!A2:D; 'February'!A2:D}, and build the pivot table on the result.

How to Use VLOOKUP With IF Statement in Sheets

Handling multiple columns in pivot tables

Several number columns can be summarized at once. Take campaign data with the columns Campaign Type, Budget Spent, Clicks and Conversions. Select the data and insert a pivot table.

  • Rows: Add “Campaign Type” to the Rows section. This categorizes the data by the type of marketing campaign.

  • Values: Add “Budget Spent” and “Clicks” to the Values section. This allows you to analyze these metrics for each campaign type.

  • Adjust the settings for “Budget Spent” and “Clicks” to summarize the data appropriately (e.g., SUM, AVERAGE).

  • Add Conversions as a third value.

Marketing campaign data table in Google Sheets followed by a pivot table showing the total sums for each metric.

The pivot table shows budget, clicks and conversions for each campaign type in one row, which makes the campaign types easy to compare.

Using COUNT functions in pivot tables

With Summarize by set to COUNTA, a pivot table counts rows instead of adding numbers. COUNTA counts every non-empty cell, so it also works on text; COUNT counts only numbers. See our guide to the count functions for the difference.

To see how many clicks each ad received, with one row per click in the source data, add the ad to Rows and to Values, summarized by COUNTA:

Google Sheets table tracking ad clicks by date, with a pivot table showing the count of each ad clicked using the COUNTA function.

Using pivot table slicers

A slicer is a filter that sits on the sheet as a button. Readers of the report can change it without opening the pivot table editor, and one slicer can control several pivot tables and charts built on the same data.

1. Create the Pivot Table:

  • Select your dataset.
  • Choose Insert → Pivot table.
  • Set up the pivot table with relevant rows, columns, and values.

Table in Google Sheets showing campaigns with clicks, conversions, and ROI, along with a pivot table that summarizes clicks and conversions by campaign type.

2. Add Slicers:

  • Click anywhere inside the pivot table to activate it.
  • In the menu, click on “Data” and select “Add a slicer.”

Google Sheets interface showing the “Add a slicer” option selected from the Data menu to filter pivot table data.

  • Choose the variable you want to use as a slicer, in this case, we have selected “Campaign Type.”

Pivot table in Google Sheets with a visible slicer set to filter by campaign type, showing the Campaign Type field and its filter options.

3. Use Slicers for Filtering:

  • A slicer control panel will appear on your sheet.
  • Click on a specific campaign type in the slicer panel.
  • The pivot table will instantly update to display data only for the selected campaign type.

Pivot table filtered using a slicer, showing only Email campaign data in the summary for clicks and conversions.

💡 To filter with a formula instead, see our guide to the FILTER function.

The Ultimate Guide to Using FILTER Function in Google Sheets

Creating dynamic ranges in pivot tables

An open-ended range lets a pivot table pick up new rows without any editing. Take a monthly marketing report that gets new campaign rows every month.

Monthly campaign performance data in Google Sheets with a grouped pivot table summarizing data by month and campaign name.

Click the pivot table and, at the top of the editor, change the range from B2:F12 to B2:F. Without a row number at the end, the range reaches to the bottom of the sheet.

Pivot table editor in Google Sheets showing a pop-up to select a dynamic data range from a worksheet.

Rows added later are included automatically:

Spreadsheet showing campaign data by month with a pivot table summarizing clicks and impressions.

Tip: An open range also includes the empty rows below the data, which show up as a blank row in the pivot table. To hide it, click Add next to Filters, choose the row field and untick (Blanks).

Pivot table showing filtered campaign data by month with selected values in the filter menu.

Handling text values in pivot tables

Text fields are what a pivot table groups by: product names, categories, sales reps. Take a sales dataset with the columns Product Name, Sales Rep and Units Sold.

  • Rows: Place “Product Name” in the rows section to list all products.
  • Columns: Add “Sales Rep” to the columns section to see sales by each salesperson.
  • Values: Place “Units Sold” in the values section to calculate the total units sold.

Table of product sales by sales rep with a pivot table showing total units sold by product and rep.

In Rows and Columns, text works without any setup. In Values, a text field can only be counted (COUNTA or COUNTUNIQUE), because there is nothing to add up.

Conditional formatting in pivot tables

Conditional formatting makes high and low values stand out. Take a pivot table of sales by product and sales rep.

Product sales data with a pivot table organizing total sales by product and sales rep.

1. Select your pivot table.

2. Choose Format → Conditional formatting.

Format menu opened in a spreadsheet while using pivot table with ‘Conditional formatting’ highlighted.

3. Check the range the rule applies to (here H3:H17).

Conditional formatting settings open with a selected data range in a pivot table column.

4. Under Format cells if…, choose a condition.

  • Here the condition is Greater than with the value 650, which highlights every cell above 650.

Cells in a pivot table highlighted using conditional formatting for values greater than 650.

  • To mark low values as well, click Add another rule and use Less than.

Pivot table with conditional formatting for values less than 600 applied in orange.

The Color scale tab of the same panel shades the cells from low to high instead of using fixed thresholds.

Removing grand totals in pivot tables

Totals and subtotals can be switched off when they get in the way, for example when the pivot table feeds a chart.

Google Sheets showing sales data. A pivot table on the right summarizes total sales per product within each category.

Click the pivot table and, in the editor, untick Show totals under the field in Rows or Columns.

Pivot table in Google Sheets with rows organized by Product Category and Product Name. The table shows the SUM of Sales Amount for each product.

Deleting a pivot table

Deleting a pivot table does not touch the source data.

  1. Select all the cells of the pivot table.
  2. Press the Delete key.

If the pivot table is on its own sheet, deleting the sheet does the same.

Common problems with pivot tables

Common problems with pivot tables

New rows are missing

⚠️ Problem: Data was added below the source range, and the pivot table does not show it. ✅ Solution: Open the editor and extend the range, or use an open-ended range such as B2:F so that new rows are always included.

The numbers do not change after an edit

⚠️ Problem: The source data was edited, and the pivot table still shows the old result. ✅ Solution: Pivot tables in Google Sheets recalculate on their own; there is no Refresh command. Check that the edited cells are inside the source range, and reload the page if the sheet is very large. If the source is filled by IMPORTRANGE or another import function, the delay is in the import.

A blank row or column appears

⚠️ Problem: The pivot table has a row or column with no label. ✅ Solution: The source range includes empty rows. Add a filter on the row field and untick (Blanks).

The same category appears twice

⚠️ Problem: “Email” and “email”, or “Email” with a trailing space, are shown as two rows. ✅ Solution: A pivot table groups by exact text. Clean the column in the source data.

Dates cannot be grouped

⚠️ Problem: Create pivot date group is not available. ✅ Solution: The dates are stored as text. Convert the column to real dates.

A ratio is wrong in the totals

⚠️ Problem: A rate column that is summed or averaged gives a meaningless grand total. ✅ Solution: Use a calculated field summarized by Custom, for example =SUM(Conversions)/SUM(Clicks).

The spreadsheet is slow

⚠️ Problem: Pivot tables on very large ranges make the file slow. ✅ Solution: A spreadsheet can hold up to 10 million cells, but it slows down well before that. Remove columns you do not need, pre-aggregate the data, or keep the detail in a data warehouse and bring only the summary into the sheet.

💡 To turn a pivot table into a chart, see our guide to pivot charts in Google Sheets.

Related Google Sheets functions

Functions and features that are often used next to pivot tables, each with its own guide:

  • XLOOKUP: An improved version of VLOOKUP, providing greater flexibility and modern functionality for data lookup.
  • UNIQUE: Filters a data range to eliminate duplicate values, ensuring only unique data points are presented.
  • CONCATENATE: Joins two or more text strings into one.
  • IMPORTXML, IMPORTHTML and IMPORTFEED: Import data from web pages and feeds into a spreadsheet.
  • SEARCH Function: It is used to find the position of a specific substring within a text string. It is particularly useful for data analysis and text manipulation tasks
  • Exploratory data analysis: Walks through summarising and visualising a dataset before building reports on it.
  • SPARKLINE: Draws a miniature chart inside a single cell.
  • SPLIT: Divides the text in a cell into separate columns around a delimiter such as a comma or a space.

A pivot table summarizes whatever is in the range

A pivot table summarizes whatever is in the range

A pivot table is honest about one thing only: it adds up the rows it was given. Whether those rows are complete, current and counted once is decided before the pivot table exists. In most reporting sheets, the range under the pivot table is an export somebody pasted in, and the summary on top of it is presented as if it came straight from the source.

The OWOX Data Marts extension for Google Sheets covers that half. A data analyst publishes a data mart (a table or an SQL query in your data warehouse) and makes it available for reports. In Sheets you open the extension, pick the data mart, tick the columns you want and run it. The rows land in a tab, ready for your formulas.

Google Sheets with the OWOX Data Marts extension open beside an ad spend table: the Unified Ad Spend data mart, nine of fourteen columns ticked and a Save & Run button – the rows in the sheet come from a governed data mart, not a pasted export

What changes for the person who maintains the sheet:

  • Refresh replaces re-export. Refresh current report in the extension menu re-runs the same pull, and a scheduled refresh keeps the tab current without anyone touching it.
  • The source is written on the sheet. The header cell of an imported tab carries a note with the data mart it came from, the time of the import and a link to the report.
  • No SQL and no warehouse access needed. The analyst decides which data marts and columns are available. You choose from that list.

The extension does not write or change the analyst’s SQL, and it does not replace the pivot table: you still decide how to slice the data. With an open-ended range on the imported tab, a refreshed import flows into the pivot table without anyone touching either. The extension comes with the OWOX Cloud plans of OWOX Data Marts; spreadsheet reporting describes both ways data reaches a sheet.

Your New Normal

Turn your data into decisions.

Governed data marts give you the clean foundation ML needs to actually work.

  • No AI hallucinations
  • Analyst-governed definitions
  • Every number traces to SQL
Get started free

FAQ

Frequently Asked Questions

Are pivot tables the same in Excel and Google Sheets?

Pivot tables in Excel and Google Sheets share many similarities in functionality, but there are differences in features and interface. Excel offers more advanced features for pivot tables, whereas Google Sheets is simpler and more user-friendly but with fewer advanced options.

How do I get pivot data in Google Sheets?

To get pivot data in Google Sheets, first create a pivot table from your dataset. Then, select the data you want to analyze and drag fields into the row, column, value, or filter sections of the pivot table to display the data as required.

How do I do a pivot table in Google Sheets?

To create a pivot table in Google Sheets, select your data range, go to the "Insert" menu, and choose "Pivot table." You can choose to open a new sheet for the pivot table or select a cell in the current sheet, where you can arrange your data fields into rows, columns, values, and filters to analyze your data.

What is a pivot table used for?

A pivot table is a powerful tool used to summarize, analyze, explore, and present large datasets in a spreadsheet. It allows users to dynamically reorganize and group data, perform calculations like sums and averages, and identify patterns or trends, facilitating efficient data-driven decision-making.

Who wrote this

Vadym Kramarenko

Vadym Kramarenko · Growth Marketing Manager

Vadym Kramarenko is a Growth Marketing Manager at OWOX, where he drives user acquisition and product-led growth strategies. He hosts the OWOX podcast, interviewing analytics professionals about data-driven marketing, attribution, and reporting best practices. Vadym specializes in turning complex analytics concepts into practical, actionable marketing frameworks.