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

前端 未结 3 1653
北荒
北荒 2020-12-16 18:30

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

Month | Product | Amount | Interval in sec
------------------------------         


        
3条回答
  •  感情败类
    2020-12-16 18:57

    You need to refer to the pivot table data in your formula, something like this:

    =GETPIVOTDATA("Sum of Amount",$A$3,"Product","A")/GETPIVOTDATA("Average of Interval",$A$3,"Product","A")

    Edit: From your spreadsheet: To add your desired column to Pivot Table A:

    K5=GETPIVOTDATA("Sum of Amount",$H$2,"Month",DATE(2012,5,1),"Product","Prod A")/GETPIVOTDATA("Average of Interval",$H$2,"Month",DATE(2012,5,1),"Product","Prod A")
    K6=GETPIVOTDATA("Sum of Amount",$H$2,"Month",DATE(2012,5,1),"Product","Prod B")/GETPIVOTDATA("Average of Interval",$H$2,"Month",DATE(2012,5,1),"Product","Prod B")
    K7=GETPIVOTDATA("Sum of Amount",$H$2,"Month",DATE(2012,5,1),"Product","Prod C")/GETPIVOTDATA("Average of Interval",$H$2,"Month",DATE(2012,5,1),"Product","Prod C")
    

    You can also produce the column by adding an extra column to the original data table of: Amount/Sec for each individual entry then when you pivot all the data the product of that column will be your desired result.

    Edit (2):

    The formulas above are cell formulas not pivot table formulas which can't use references sorry I didn't make that clear. I am looking into a pivot table calculation formula but for now the above as a column alongside your pivot table should produce what you need.

提交回复
热议问题