• Status: Solved
• Priority: Medium
• Security: Public
• Views: 623

# Custom formula in Pivot Table

I am fiddling about with a Pivot Table to analyse my mobile phone bill and have come up against a small problem. I have been able to organise the Pivot Table as follows:

Call Type
Person Called     Data                  SMS   Voice Call
Person1          Sum of Charge Amount
Sum of Duration
Count of Call Type

(I appreciate that EE will change the layout of the table due to fonts, but if you cut and paste into notepad, you should be able to recreate it).

Basically, what I want to be able to do is to add a new row Average call cost. The only problem is that for SMS I want it to be the "sum of charge amount" / "count of call type" and for Voice Call "sum of charge amount" / ("Sum of duration" * 25 * 60). I'm obviously doing something wrong, since inserting a new row myself and altering the formula doesn't seem to work. Given that the duration of an SMS is always 0 and I want to avoid horrid "#DIV/0!" messages in the table, I would prefer to only have one row (i.e. I would prefer not to have two averages, one by duration and the other by count).

Hopefully, I'm missing something simple???
0
gd2000
1 Solution

Billing EngineerCommented:
You have to use the IF to check the "sum of duration"=0.
Now, i have as separator the , in the formula, you might have the ; instead.

if( "sum of duration" = 0, 0 , "sum of charge amount" / ("Sum of duration"  * 25 * 60))

CHeers
0

Author Commented:
That doesn't seem to work for me. I'm trying to insert a calculated field (i.e. a new row), which is dependant on the call type. Also the formula doesn't seem to recognise the rows "Sum of duration" etc. despite the fact that they're there (it only seems to allow me to have information from the source data; i.e. duration per call etc.)
0

Commented:
Hi qd2000

Have you thought of putting the Sum of Charge Amount,     Sum of Duration and Count of Call Type as columns with SMS and Voice as two rows for each person.  Then you could put a formula in the column alongside the pivot table that does just what you want.

Regards

Packhorse
0

Author Commented:
Have something similar to that - but I wanted this as part of the Pivot Table, so updates are controlled within the pivot table.

Is what I'm asking for possible? I know simple calculations are possible, but surely an "if" statement is allowed?
0

Commented:
any progress here?
0

Author Commented:
No progress whatsoever. The suggestions were not what I was looking for.

What would you recommend I do bruintje?
0

Commented:
Hello gd2000

this question is open for more then 2 months
time to clean up
if not stated otherwise

my recommendation will be
-PAQ and refund
-this will be finalized by an EE Moderator
-with no further update (23.11.2002)

HAGD:O)Bruintje
posted by ToolzEE v1.0
0

Commented:
Per recommendation, points refunded and question closed.

Netminder