PivotTable values: Sum, Count, Average and Value Field Settings
How to show count, average, max or distinct count instead of a sum in a PivotTable, rename the value column and set a number format that sticks.
The Values area is the PivotTable’s calculator. Drop a numeric field there and Excel automatically calculates a Sum. But the question is often different: “How many sales were there?”, “What is the average sale?”, “What was the biggest deal?”.
All of that is changed in one dialog — Value Field Settings. You can also put the same field into Values several times and see different calculations side by side.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Row Labels | Sum of Amount | Count of Amount | Average of Amount | |
| 2 | Bukhara | 26 600 000 | 2 | 13 300 000 | |
| 3 | Samarkand | 20 500 000 | 2 | 10 250 000 | |
| 4 | Tashkent | 41 500 000 | 3 | 13 833 333 | |
| 5 | Grand Total | 88 600 000 | 7 | 12 657 143 | |
| 6 |
Changing the calculation
1
Right-click any value in the PivotTable and choose Value Field Settings.... Alternatively, click the field name in the Values area of the pane → Value Field Settings.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Row Labels | Sum of Amount | ||
| 2 | Bukhara | 26 600 000 | ||
| 3 | Samarkand | 20 500 000 | ||
| 4 | Tashkent | 41 500 000 | ||
| 5 | Grand Total | 88 600 000 | ||
| 6 |
2
In the Summarize value field by list pick the calculation: Average, Count, Max / Min. The name in Custom Name updates automatically.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Row Labels | Sum of Amount | ||
| 2 | Bukhara | 26 600 000 | ||
| 3 | Samarkand | 20 500 000 | ||
| 4 | Tashkent | 41 500 000 | ||
| 5 | Grand Total | 88 600 000 | ||
| 6 |
3
Type a clear Custom Name, such as “Average sale”. Note: the name can’t be identical to a source column name — type “Amount” and Excel says “PivotTable field name already exists”. Workaround: add a trailing space (“Amount ”) or pick another name.
4
In the same dialog click Number Format, choose the Number category, set Decimal places to 0 and tick Use 1000 Separator (,). The format is applied to the whole field and survives refreshes.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Row Labels | Average of Amount | ||
| 2 | Bukhara | 13300000 | ||
| 3 | Samarkand | 10250000 | ||
| 4 | Tashkent | 13833333,33 | ||
| 5 | Grand Total | 12657142,86 | ||
| 6 |
5
Need several calculations side by side? Drag Amount into Values again — Sum of Amount2 appears. Switch it to Count and a third copy to Average (the result above).
Which calculation for what
- Sum — revenue, quantity, costs. The default for numeric fields.
- Count — the number of non-empty cells (text counts too): how many sales, how many orders. The default for text fields.
- Average — average sale, average score.
- Max / Min — the biggest sale, the lowest price.
- Count Numbers — only cells that contain numbers.
- Product, StdDev, Var — product, standard deviation, variance for statistical analysis.
Important: the Grand Total row uses the same calculation. For Average, the Grand Total is the average of all sales (12,657,143), not the average of the regional averages.
Pro level: Distinct Count
A regular PivotTable has no Distinct Count. It appears only in a PivotTable based on the Data Model:
- In the create dialog tick Add this data to the Data Model.
- Drop the Manager field into Values.
- Value Field Settings → pick Distinct Count at the bottom of the list.
A Data Model PivotTable can also combine several related tables. The trade-off: instead of Calculated Fields and manual date grouping you use DAX measures (Power Pivot).
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Row Labels | Count of Manager | Distinct Count of Manager | |
| 2 | Bukhara | 2 | 1 | |
| 3 | Samarkand | 2 | 1 | |
| 4 | Tashkent | 3 | 21 | |
| 5 | Grand Total | 7 | 4 | |
| 6 |
Try it in the simulator
Check Count and Average with formulas. Type =СЧЁТЕСЛИМН($A$2:$A$8;D2) in E2 and =СРЗНАЧЕСЛИМН($B$2:$B$8;$A$2:$A$8;D2) in F2, then fill both down to row 4. Tashkent: 3 sales, average 13833333.33.
| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Region | Amount | Region | Sales | Average sale | |||||||||||||||||||
| 2 | Tashkent | 25500000 | Bukhara | |||||||||||||||||||||
| 3 | Samarkand | 12000000 | Samarkand | |||||||||||||||||||||
| 4 | Tashkent | 6400000 | Tashkent | |||||||||||||||||||||
| 5 | Bukhara | 17000000 | ||||||||||||||||||||||
| 6 | Samarkand | 8500000 | ||||||||||||||||||||||
| 7 | Tashkent | 9600000 | ||||||||||||||||||||||
| 8 | Bukhara | 9600000 | ||||||||||||||||||||||
| 9 | ||||||||||||||||||||||||
| 10 | ||||||||||||||||||||||||
| 11 | ||||||||||||||||||||||||
| 12 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.