在 Excel 数据透视表中将值显示为占总计的百分比

在 Excel 中打开“值字段设置 > 值显示方式”,选择“总计的百分比”,或按列、按行的百分比。Google Sheets 在值字段的 Show as 中选择 % of grand total。底层数字不变,只改变显示。可以把同一字段拖进值区域两次,一次求和、一次百分比。

本文目录

快速解答

在 Excel 中打开“值字段设置 > 值显示方式”,选择“总计的百分比”,或按列、按行的百分比。Google Sheets 在值字段的 Show as 中选择 % of grand total。底层数字不变,只改变显示。可以把同一字段拖进值区域两次,一次求和、一次百分比。

=9450/24450
=19800/24450
=12600/24450

检查要点

八行销售样本中,合计 24450,东区 9450,Widget 19800,Maya 12600。2026 年 11 月 12 日测试中,9450/24450 为 0.38650306748466257,19800/24450 为 0.8098159509202454,12600/24450 为 0.5153374233128835。透视表显示的百分比应与这些未四舍五入的份额一致。

边界与兼容性

显示为 39% 是四舍五入的结果;把舍入后的百分比加起来可能到不了 100%。筛选会改变作为分母的总计,去掉西区后东区会变成剩下 9450 的 100%。若值仍是计数,看到的将是行数占比。不要用计算字段去写 =Revenue/GrandTotal,应使用“值显示方式”。

完整英文示例、公式与作者备注

Tested in: The share figures below were evaluated in Google Sheets on 12 November 2026. Excel 365 menu names are the current desktop labels; I did not click Show Values As in Excel this session.

This is a display option on a field you already have. It is not a calculated field. For the same math outside a pivot, use the percentage of total calculator.

Change Show Values As

In Excel 365

  1. Click a number in the Values area, or open the field’s menu in the Values well.
  2. Choose Value Field Settings.
  3. Open the Show Values As tab (in some builds this is a drop-down on the same dialog).
  4. Pick % of Grand Total, % of Column Total, or % of Row Total.
  5. Click OK. Format as a percentage if the cells do not already show a % sign.

To keep the original sums visible, drag Revenue into Values a second time and set only the copy to % of Grand Total. You will see “Sum of Revenue” and “Sum of Revenue2” (rename the second to “Share”).

In Google Sheets

  1. Click the pivot to open the editor.
  2. In Values, open the field.
  3. Set Show as to % of grand total, % of row, or % of column.

Check the shares against the sheet

On the eight-sale sample, Revenue sums to 24450, East is 9450, Widget is 19800, and Maya is 12600. In Google Sheets on 12 November 2026:

=9450/24450
=19800/24450
=12600/24450

Those returned 0.38650306748466257, 0.8098159509202454, and 0.5153374233128835. A pivot that shows % of Grand Total for those items should match once you display enough decimals. West is 1 − East, or 0.6134969325153374.

% of Column Total is useful when Dates or Products run across the top and you want each column to add to 100%. % of Row Total does the same across a row. % of Parent Total (Excel) and % of parent (Sheets, when available) are for hierarchical layouts — for example, a product’s share of its region, not of the workbook grand total.

If Values is still on Count, you will be looking at a share of row counts, not of money. Switch the summary to Sum first; the percentage option does not fix a count.

Rounding, filters, and differences from a calculated field

A share displayed as 39% has been rounded; the unrounded East figure is 38.650…%. Adding rounded percentages can miss 100% by a point. That is a display issue, not a sign that the pivot is wrong.

A filter changes the grand total the percentage is based on. If you filter out West, East becomes 100% of the remaining 9450, not 38.65% of 24450. Decide whether you want the share of everything or the share of the visible slice before you apply the filter.

Do not build % of total as a calculated field like =Revenue/GrandTotal. There is no GrandTotal field to divide by, and a calculated field will not automatically use the pivot’s grand total the way Show Values As does. Leave percentages to Show Values As, and use a calculated field for a commission or a difference you can write with the field names you already have.

Oscar

专注电子表格公式与排错;具体测试环境和待验证事项见各篇文章。

Tested in Google Sheets (via Sheets API) on 12 November 2026: East 9450 / 24450 = 0.38650306748466257; Widget 19800 / 24450 = 0.8098159509202454; Maya 12600 / 24450 = 0.5153374233128835. Excel 365 menu names are the current desktop labels; I did not click Show Values As in Excel this session..

本主题下一篇:查找与条件求和 XLOOKUP 返回 #N/A,但值明明存在:7 种修复方法