Microsoft Excel Sum 中正数和负数的透视错误计算

Microsoft Excel Pivot miscalculation in Sum for positive and negative numbers

我不确定是我做错了什么(可能是)还是微软有问题Excel。

场景: 我创建了一个 table 如下

+------+-------+
| Name | Value |
+------+-------+
| Alex | 1.55  |
| Alex | -1.56 |
| Alex | 0.01  |
+------+-------+

当我尝试获取数据透视表中的值总和时,结果如下:

+-------------+--------------+
| Row Labels  | Sum of Value |
| Alex        | -8.67362E-18 |
| (blank)     |              |
| Grand Total | -8.67362E-18 |
+-------------+--------------+

我希望 [总和] 显示 0,但它显示的是非零值 (-8.67362E-18)。

提前致谢

虽然这是浮点计算的正常行为,请参阅 https://support.microsoft.com/en-us/kb/78113 and https://support.microsoft.com/en-us/kb/214118,但它很丑陋,因为它在枢轴 tables 和普通 excel 工作表中的行为不同。

Sheet:

B5中的公式是

=SUM(B2:B4)

如您所见,结果为 0。

枢轴 table:

如您所见,正常计算的总和是 而不是 0。不,主元 tables 不会遵守设置 "Precision as Displayed".

我做了什么?

添加了计算字段 "Feld1",参见 https://support.office.com/en-us/article/Calculate-values-in-a-PivotTable-report-697406b6-ee20-4a39-acea-8128b5e904b8#bmcreate_a_formula,公式为:

=ROUND(值, 8)

并用这个求和。