How to insert a calculated field within the data section?

poiu

Active Member
Joined
Sep 13, 2011
Messages
384
Hi,

I need to add a calculated field into the data area of a pivot table, please could you tell me how to do this?

For example, if I have the following source data:

Period, Cost Centre, GL Account, Amount
P1-P10, CC1000, 600000, 10000
P1-P10, CC1000, 700000, 20000
P12, CC1000, 600000, 1000
P12, CC1000, 700000, 2000
P1-P12, CC1000, 600000, 12000
P1-P12, CC1000, 700000, 24000


I would like to output the following pivot table (with a calculated field for P11):

Cost Centre, GL Account, P1-P10, P11 (Calculated Field), P12, P1-P12
CC1000, 600000, 10000, 1000, 1000, 12000
CC1000, 700000, 20000, 2000, 2000, 24000


My problem is that I think a calculated field has to be calculated on the field names of the source data, but I am looking to calculate on categories within a field (i.e. period ranges within the "Period" field)?

Thanks,

Poiu
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Select the Period field and insert a Calculated Item with the formula:

='P1-P12' -P12 -'P1-P10'

Result:

Sum of Amount Period
Cost Centre GL AccountP12P1-P10P11P1-P12Grand Total
CC100060000010001000040001500030000
70000020002000020002400048000
CC1000 Total30003000060003900078000
Grand Total30003000060003900078000

<tbody>
</tbody><colgroup><col><col><col span="4"><col></colgroup>
 
Upvote 0
Thank you Andrew, that's great.

When I insert a calculated item all I see is the heading "Formula1" - there is no popup window that allows me to enter a formula (which should happend according to this - Calculated Items in Pivot Tables « Guj800).

Please could you tell me how to enter a formula when all I can see is "Formula1" without a popup box?

Thank you,

Poiu
 
Upvote 0
Yes - I'm using Excel 2003. I've figured it out - Insert->Insert item doesn't bring up the popup, but if I go to the pivot table toolbar->Formulas->insert item then it does work.

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,968
Messages
6,122,506
Members
449,089
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top