How do I calculate the median in a pivot table using Google Sheets?

To calculate the median in a pivot table using Google Sheets, you can first select the data you want to use in the pivot table. Then, click on the “Data” tab and select “Pivot table” from the drop-down menu. In the pivot table editor, select the column or data field that you want to find the median for. Next, click on the “Summarize by” drop-down menu and select “Median” as the calculation type. This will automatically calculate the median for the selected data field in the pivot table. You can also adjust the pivot table settings to show the median for different groups or categories within the data.


The following step-by-step example shows how to create a pivot table in Google Sheets that displays the median value of a certain variable.

Step 1: Enter the Data

First, let’s enter the following data that shows the total revenue generated by certain products in certain regions for some company:

Step 2: Create the Pivot Table

To create a pivot table that summarizes this dataset, click the Insert tab and then click Pivot table:

In the window that appears, type Sheet1!A1:C17 as the Data range and choose to insert the pivot table in the Existing sheet in cell E2:

Once you click Create, an empty pivot table will automatically be inserted.

In the Pivot table editor that appears on the right side of the screen, click Add next to Rows and choose Region.

Then click Add next to Values and choose Revenue:

By default, the pivot table will attempt to summarize the Revenue values by using SUM.

To instead display the MEDIAN of Revenue, click the dropdown arrow under Summarize by and click MEDIAN:

The pivot table will update to show the median value of Revenue for each Region:

Google Sheets pivot table median

For example, we can see:

  • The median value in the Revenue column for the East Region is 9.
  • The median value in the Revenue column for the North Region is 7.5.

And so on.

Additional Resources

The following tutorials explain how to perform other common operations in Google Sheets:

x