

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 数据透视表计算函数


您可以在数据透视表计算中使用以下函数。

**Topics**
+ [

## Running total
](#running-total)
+ [

## 区别
](#difference)
+ [

## Percentage difference
](#percent-difference)
+ [

## Percent of total
](#percent-of-total)
+ [

## Rank
](#rank)
+ [

## 百分位数
](#percentile)

您可以将列出的函数应用于以下数据：

![\[alt text not found\]](http://docs.amazonaws.cn/quick/latest/userguide/images/running-total1.png)


![\[alt text not found\]](http://docs.amazonaws.cn/quick/latest/userguide/images/running-total1.png)


## Running total


**Running total** 函数计算给定单元格值与其之前的所有单元格值的总和。此总和的计算方法为 `Cell1=Cell1, Cell2=Cell1+Cell2, Cell3=Cell1+Cell2+Cell3`，依此类推。

**计算方式**选择**表横向**，沿表行应用 **Running total** 函数会得到以下结果。

![\[alt text not found\]](http://docs.amazonaws.cn/quick/latest/userguide/images/running-total2.png)


## 区别


**Difference** 函数计算单元格值与其之前单元格值的差值。此差值的计算方法为 `Cell1=Cell1-null, Cell2=Cell2-Cell1, Cell3=Cell3-Cell2,`，依此类推。由于 `Cell1-null = null`，Cell1 值始终为空。

**计算方式**选择**表横向**，沿表行应用 **Difference** 函数得到以下结果。

![\[alt text not found\]](http://docs.amazonaws.cn/quick/latest/userguide/images/difference.png)


## Percentage difference


**Percentage Difference** 函数计算单元格值与其之前单元格值的百分比差值，然后除以其之前单元格的值。此值的计算方法为 `Cell1=(Cell1-null)/null, Cell2=(Cell2-Cell1)/Cell1, Cell3=(Cell3-Cell2)/Cell2,`，依此类推。由于 `(Cell1-null)/null = null`，Cell1 值始终为空。

**计算方式**选择**表横向**，沿表行应用 **Percentage Difference** 函数得到以下结果。

![\[alt text not found\]](http://docs.amazonaws.cn/quick/latest/userguide/images/percentage-difference.png)


## Percent of total


**Percent of Total** 函数计算给定单元格占计算中包含的所有单元格总和的百分比。此百分比的计算方法为 `Cell1=Cell1/(sum of all cells), Cell2=Cell2/(sum of all cells),`，依此类推。

**计算方式**选择**表横向**，沿表行应用 **Percent of Total** 函数得到以下结果。

![\[alt text not found\]](http://docs.amazonaws.cn/quick/latest/userguide/images/percent-of-total.png)


## Rank


**Rank** 函数计算单元格值与计算中包含的其他单元格值相比较的排名。Rank 始终将最高值显示为 1，最低值等于计算中包含的单元格数。如果两个或更多单元格具有相等的值，则它们排名相同，但在排名中各占一位。因此，下一个最高值的排名将下降该值所占的单元格数减 1。例如，如果对 5,3,3,4,3,2 排名，它们的排名将是 1,3,3,2,3,6。

例如，假设您具有以下数据。

![\[alt text not found\]](http://docs.amazonaws.cn/quick/latest/userguide/images/rank.png)


**计算方式**选择**表横向**，沿表行应用 **Rank** 函数得到以下结果。

![\[alt text not found\]](http://docs.amazonaws.cn/quick/latest/userguide/images/rank2.png)


## 百分位数


**Percentile** 函数计算的是计算中包含的等于或低于给定单元格值的单元格值百分比。

此百分比的计算方式如下：

```
percentile rank(x) = 100 * B / N

Where:
   B = number of scores below x
   N = number of scores
```

**计算方式**选择**表横向**，沿表行应用 **Percentile** 函数得到以下结果。

![\[alt text not found\]](http://docs.amazonaws.cn/quick/latest/userguide/images/percentile.png)
