Excel, Pivot Calculated formula: SUM(Field1)/AVG(Field2)

Posted by Bas on Stack Overflow See other posts from Stack Overflow or by Bas
Published on 2012-09-13T08:21:51Z Indexed on 2012/09/13 9:38 UTC
Read the original article Hit count: 184

I've a simple table with some amount and interval in sec by date and product name.

Month | Product | Amount | Interval in sec
------------------------------------------
05-'12| Prod A  | 10     | 5
05-'12| Prod A  | 3      | 5
05-'12| Prod B  | 4      | 5
05-'12| Prod C  | 13     | 5
05-'12| Prod C  | 5      | 5

From this table I've derived a Pivot table with SUM(Amount), AVERAGE(Interval in sec) by Month and Product.

Month | Product | SUM of Amount | AVG of Interval in sec
--------------------------------------------------------
05-'12| Prod A  | 13            | 5
05-'12| Prod B  | 4             | 5
05-'12| Prod C  | 18            | 5

So far So good... Now i want to add and extra column to my Pivot table with gives me the outcome of SUM of Amount / AVG of Interval in sec

Adding a calculated value =SUM(Amount)/AVERAGE(Interval) is not giving me the right values. Exel gives me.

Month | Product | SUM of Amount | AVG of Interval in sec | Amount per sec
-------------------------------------------------------------------------
05-'12| Prod A  | 13            | 5                      | 1.3
05-'12| Prod B  | 4             | 5                      | 0.8
05-'12| Prod C  | 18            | 5                      | 1.8

What it actually is doing is =SUM(Amount)/SUM(Interval in sec) for every Month and Product based on the values in the first table...

But I'm looking for

Month | Product | SUM of Amount | AVG of Interval in sec | Amount per sec
-------------------------------------------------------------------------
05-'12| Prod A  | 13            | 5                      | 2.6
05-'12| Prod B  | 4             | 5                      | 0.8
05-'12| Prod C  | 18            | 5                      | 3.6

So litterly devide pivot field 'Sum of Amount' by pivot field 'AVG of Interval in sec'

How to achieve this?

Thank you in advanced

© Stack Overflow or respective owner

Related posts about excel

Related posts about pivot-table