#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default pivot formula

I have a pivot table with revenues and expenses. The revenues has to
shown as a positive and the expenses are positive.I then want the
grand total to be the difference betweem the revenue and expenses. I
dont want to change the data just the pivot. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default pivot formula

Hi
The only way I can think of doing this if you do not want your expenses to
be negative values, would be to right click on the
Pivot TableTable Optionsuncheck Grand Total by columns
Then, in the blank row above your Sum of Amount (or whatever you have titled
it) Enter the Title "Profit" and in the cell above the Total column enter a
GetPivotdata formula some thing like
=GETPIVOTDATA("amount",$J$4,"type","i")-GETPIVOTDATA("amount",$J$4,"type","e")

In my case Type is a filed which holds "i" for Income and "e" for
Expenditure
J4 is the cell holding Sum of Amount
Adjust to suit your case.
Using GetPivotdata as opposed to direct cell reference, will adjust as the
PT grows or shrinks

It is not pretty, and may not be acceptable to you, but without having
negative expenses I cannot see any other way to make it work.

The only "proper" way to do it, leaving your source data as all positive
values, would be to add another column "Amount2" with a formula like
=IF(A2="e",C2*-1,C2)
where column A holds type and column C holds value.
Allocate Amount2 to the PT in place of Amount, and switch Grand Totals by
column back on.
--
Regards
Roger Govier

"snax500" wrote in message
...
I have a pivot table with revenues and expenses. The revenues has to
shown as a positive and the expenses are positive.I then want the
grand total to be the difference betweem the revenue and expenses. I
dont want to change the data just the pivot. Thanks.

__________ Information from ESET Smart Security, version of virus
signature database 4508 (20091014) __________

The message was checked by ESET Smart Security.

http://www.eset.com




__________ Information from ESET Smart Security, version of virus signature database 4508 (20091014) __________

The message was checked by ESET Smart Security.

http://www.eset.com




__________ Information from ESET Smart Security, version of virus signature database 4509 (20091015) __________

The message was checked by ESET Smart Security.

http://www.eset.com



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
pivot formula officegirl Excel Discussion (Misc queries) 1 December 6th 07 11:22 PM
Pivot Formula Paul Dennis Excel Discussion (Misc queries) 1 November 13th 07 01:09 PM
cancelling getpivot formula when setting formula outside pivot ta. cancelling getpivot formula Excel Worksheet Functions 2 October 31st 06 10:31 PM
deactivate the get pivot formula when I link a cell to a pivot hwtradezheng New Users to Excel 1 January 4th 06 01:47 PM
Add a formula to Pivot Table bsfacf Excel Worksheet Functions 0 January 21st 05 05:40 AM


All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"