To add a formula (Calculated Field) as a new column in a PivotTable report:
1. Select a cell in the PivotTable report.
2. Press Alt+P to select PivotTable dropdown icon from Pivot Table toolbar, select Formulas, and then Calculated Field.
3. In the Insert Calculated Field dialog box, type the formula name in the Name box.
4. In the Fields list box, select the first field name to insert and click Insert Field. The field name is copied into the Formula box.
5. Type / (in this example), repeat step 4 to insert the second field into the formula, and then click OK.
6. To format the new field, select a cell in the field and click the Field Settings icon on the PivotTable toolbar.
CAUTION!
This option can some times return incorrect calculation results when using multiplying or dividing.
Screenshot // PivotTable report - Adding a Calculated Field
Calculated field
JZ wrote on December 31, 1969 19:00 EST
It is very helpful. I was too geek. I actually spent an hour to code the calculated fields in VBA. But this way, it only took me 5 minutes... Damn...
Multiplying and dividing
NJT wrote on December 31, 1969 19:00 EST
Be aware that formulas operate on sum totals not individual records. So a formula like =Col1*Col2 evaluates to =sum(col1)*sum(col2), not =sum(col1*col2).
Terms
and Conditions of use
The applications/code on this site are distributed as is and without warranties
or liability. In no event shall the owner of the copyrights, or the authors
of the applications/code be liable for any loss of profit, any problems
or any damage resulting from the use or evaluation of the applications/code.