In this article:

Add a Calculated Field to a Pivot Table in Google Sheets (2024)

January 25, 2024

In this article we will show how to add a calculated field to a pivot table in google sheets. Simply follow the steps below.

How to Add a Calculated Field to a Google Sheets Pivot Table

For the purpose of the below demonstration an example sheet was created, access this by clicking the link below and follow along:


Click here to see the example spreadsheet.

1. Highlight the Data Range and from the File Menu Select “Insert” > “Pivot table” 

Select the data range to be implemented in the pivot table. In this example we will highlight cells A1 to C7.

In the file menu, select Insert and then from the dropdown menu select Pivot table. 

Google Sheets pivot table calculated field: Generating a pivot table 

2 Choose To Insert in a New or Existing Sheet


From the menu that appears choose to insert your pivot table into a new sheet or an existing sheet.

For the existing sheet you will be prompted to enter the cell reference where you want the table to appear.


In our example we will select cell E2 to create our table.

Click Create to generate the pivot table.

Google Sheets pivot table calculated field

3. In the sidebar menu select “Rows” and then select data range 

 

A sidebar menu will appear showing various parameters to select for populating the pivot table. 

Click the Rows subsection and from the dropdown menu select a data range from the options available.

In our example below, the available data sets are visible by the header title that has been included in the selection.  

We will select the data in column A titled Names.

Google Sheets pivot table calculated field percentage of total: Editing the pivot table ‍

4. In the sidebar menu select “Values” and then “Calculated Field”

The first selected data range will re-format the pivot table. In the side menu click the Values subsection and from the dropdown menu select Calculated Field.

Add calculated field to pivot table Google Sheets: Selecting data sets‍

5. Enter formula in the “Values” subsection in the “Pivot table editor” 

The calculated Field range in the pivot table will automatically populate a value of 0 to all corresponding data in the ‘Rows’ column.

Pivot table Google Sheets calculated field: Entering a formula ‍

6. Enter the formula =’Cell_Ref1’ Operator ’Cell_Ref2’ in the Formula text box in “Values”

In the Formula text box, enter the additional data sets to be used in conjunction with the values in the Rows column in the following format:

=‘Cell_Ref1’Operator‘Cell_Ref2’

Formula Breakdown:

=’Cell_Ref1’: The first set of cells to be used in the formula, pre-selected in the first few steps. I our example this is the data in column A called Sales 1

Operator: The operator depends on what comparison or calculation needs to be made. In this case the operator is a plus (+) to add two datasets together.

‘Cell_Ref2’: The second set of data that the formula that will add together. In our example this will be the data in column B called Sales 2.

In the example below, we have used the formula to add the values from the sales column together for each name.

='Sales 1'+'Sales 2’

7. See populated results generated in the pivot table

 

The results will now be populated into the pivot table

As can be seen in the example below, the calculation will automatically generate the inputted results including a grand total of all results 

Google Sheets calculated field pivot table: Formula generated results

We hope this article has helped you and given you a better understanding of how to add a calculated field to a pivot table in Google Sheets. You might also like our articles on how to refresh a pivot table and how to sort a pivot table in Google Sheets. We also recommend reading our guide on how to hyperlink an email address in Google Sheets.

Check out our software for timesheet approval.

Get Google Sheets productivity and automation tips delivered straight to your inbox
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
We'll email you 1-3 times a week — and never share your information.
Get your copy of our free Google Sheets automation guide!
  • 27 pages of Google Sheets tips and tricks to save time
  • Covers pivot tables and other advanced topics
  • 100% free

Work less, automate more!

Use Lido to connect your spreadsheets to email, Slack, calendars, and more to automate data transfers and eliminate manual copying and pasting. View all use cases ->