A frequent question that comes up when working with Excel PivotTables is how to calculate the median using the table's filters and analysis. The short answer is that there is no native option in the Value Field Settings to summarize by median. The closest built-in function is Average. The good news is that two proven workarounds let you get an excel pivot table median calculation: a MEDIAN+IF array formula placed beside your PivotTable, or a Power Pivot DAX measure that displays the median directly inside the table.
However, averages aren't always the best way to understand your data. Our example shows donations collected by a regional charity. Most of the donations are small amounts, a handful are more significant, and one or two are very large. The average donation for the year is $1380.50, but that does not accurately show us how most of our donors give. The median calculation shows us that most of our donations are around $50 with half giving more, and half giving less. This number more realistically reveals our donor giving patterns.
Median is the better choice whenever your data is skewed or contains outliers. Consider using median vs average in a pivot table analysis when you are working with:
To follow using our example below, download Calculate Median in PivotTables.xlsx
If we want to understand our donor giving patterns by state, we would naturally turn to a PivotTable and get something like we see in the first image. But what if we want the median donation for each state?
Here is the first of two workaround solutions to get a median in pivot table reporting. This approach uses the array feature to pair a MEDIAN IF array formula with your existing PivotTable layout. As with all workarounds, it may not be elegant, but it can get you started. The steps demonstrated apply to Excel 2010 and later.
Technically, the end result isn't a PivotTable, but you can use the PivotTable feature to set up your array more easily:
=MEDIAN(IF($H$2:$H$65=J19, $C$2:$C$65))
To break down the formula:
If you are using Microsoft 365 or a newer version of Excel that supports dynamic arrays, you can simply press Enter instead of Ctrl+Shift+Enter. Excel will treat the formula as a dynamic array automatically, and you will not see curly braces in the formula bar.
So, "this isn't really a PivotTable", but this method does allow you to quickly harness the visual power of PivotTables to organize your information. You still have to do the manual work of making the Median calculation, but the PivotTable step gives you a shortcut to organizing your information and creating the formula. And until Microsoft adds the MEDIAN function directly to PivotTables, this is the most common solution out there.
The array formula approach is the best fit when:
If your reporting needs are more complex or you want the median to appear directly inside the PivotTable, the Power Pivot method below is a stronger option.
The array formula method works well, but it places the median outside the PivotTable in adjacent cells. If you want to calculate median in an excel pivot table so that it appears as a native value inside the table itself, Power Pivot and a DAX median measure are the way to go. This method requires Excel 2013 Professional Plus or later or Microsoft 365.
Median Donation:=MEDIANX(Table1, Table1[Amount])
The MEDIANX function evaluates the Amount column for every row in Table1 and returns the median of those values. Click OK to save the measure.
This approach gives you a true pivot table custom calculation that lives inside the PivotTable, responds to slicers and filters and refreshes alongside your data.
Both methods deliver a reliable median, but they suit different situations. The comparison table below can help you decide.
| Factor | Array Formula Method | Power Pivot DAX Method |
|---|---|---|
| Excel versions supported | 2010 and later | 2013 Pro Plus, 2016+ and Microsoft 365 |
| Median displayed inside PivotTable | No (displayed in adjacent cells) | Yes (appears as a PivotTable value) |
| Setup complexity | Low to moderate | Moderate (requires enabling add-in) |
| Best for | Quick analysis, smaller datasets | Ongoing reporting, larger datasets, multiple groupings |
| Dynamic updates when source data changes | Manual (re-copy PivotTable values) | Automatic (refreshes with PivotTable) |
Dynamic updates when source data changes
Manual (re-copy PivotTable values)
Automatic (refreshes with PivotTable)
For a one-time look at median values, the array formula method gets the job done fast. For dashboards and recurring reports where you need the median to stay current, Power Pivot is the stronger choice. Either way, download the practice file above and try both approaches with real data. If you want to sharpen your Excel skills further, explore Pryor Learning's Excel training courses for hands-on instruction on PivotTables, formulas, Power Pivot and more.