I have a company that has a list of accounts. I need to see how many lines were canceled and kept for each account as well as for the company as a whole. So for example, for Account 4, it canceled 33% and kept 67% and Company 1 canceled 8% and kept 92%==>8% = sum(0,0,0,.3333,.5,0,0,0,0,0,0)/11; 92% = sum(1,1,1,.67,.5,1,1,1,1,1,1)/11
So I want the output to be for each company:
Company 1: Canceled 8%, Kept 92%
Account 1: Canceled 0%, Kept 100%
Account 2: Canceled 0%, Kept 100%
Account 4: Canceled 33%, Kept 67%
...Account 11: Canceled 0, Kept 100%
The problem is that I don't know how to dynamically reference all of the items in the Pivot Table (i.e. all of the Accounts). I was able to get this to work by explicitly referencing the columns but I want to replace A3:A13 with all of the items the list and that can vary depending on how many accounts each company has:
{=SUM(GETPIVOTDATA("Sum of % Kept",$A$1,"Account",A3:A13,"Company","Company1"))}/{=count(GETPIVOTDATA("Sum of % Kept",$A$1,"Account",A3:A13,"Company","Company1"))}
(Sorry, it won't let me upload anything so this is the best I can do to post the data)
<Data>
Company and Account,Total Lines Canceled,Total Lines Kept,Total Lines,Sum of % Canceled,Sum of % Kept
Company1 1,2,14,16,0.125,0.875,
Account 1,,1,1,0,1,,,
Account 2,,1,1,0,1,,,
Account 3,,3,3,0,1,,,
Account 4,1,2,3,0.333333333,0.666666667,,,
Account 5,1,1,2,0.5,0.5,,,
Account 6,,1,1,0,1,,,
Account 7,,1,1,0,1,,,
Account 8,,1,1,0,1,,,
Account 9,,1,1,0,1,,,
Account 10,,1,1,0,1,,,
Account 11,,1,1,0,1,,,
</Data>
So I want the output to be for each company:
Company 1: Canceled 8%, Kept 92%
Account 1: Canceled 0%, Kept 100%
Account 2: Canceled 0%, Kept 100%
Account 4: Canceled 33%, Kept 67%
...Account 11: Canceled 0, Kept 100%
The problem is that I don't know how to dynamically reference all of the items in the Pivot Table (i.e. all of the Accounts). I was able to get this to work by explicitly referencing the columns but I want to replace A3:A13 with all of the items the list and that can vary depending on how many accounts each company has:
{=SUM(GETPIVOTDATA("Sum of % Kept",$A$1,"Account",A3:A13,"Company","Company1"))}/{=count(GETPIVOTDATA("Sum of % Kept",$A$1,"Account",A3:A13,"Company","Company1"))}
(Sorry, it won't let me upload anything so this is the best I can do to post the data)
<Data>
Company and Account,Total Lines Canceled,Total Lines Kept,Total Lines,Sum of % Canceled,Sum of % Kept
Company1 1,2,14,16,0.125,0.875,
Account 1,,1,1,0,1,,,
Account 2,,1,1,0,1,,,
Account 3,,3,3,0,1,,,
Account 4,1,2,3,0.333333333,0.666666667,,,
Account 5,1,1,2,0.5,0.5,,,
Account 6,,1,1,0,1,,,
Account 7,,1,1,0,1,,,
Account 8,,1,1,0,1,,,
Account 9,,1,1,0,1,,,
Account 10,,1,1,0,1,,,
Account 11,,1,1,0,1,,,
</Data>