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

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???
1 Solution
Guy Hengel [angelIII / a3]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))

gd2000Author 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.)
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.


Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

gd2000Author 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?
any progress here?
gd2000Author Commented:
No progress whatsoever. The suggestions were not what I was looking for.

What would you recommend I do bruintje?
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)


posted by ToolzEE v1.0
Per recommendation, points refunded and question closed.

EE Admin
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now