NOTE: You cannot create formulas in a PivotTable report that is connected to an OLAP (OLAP: A database technology that has been optimized for querying and reporting, instead of processing transactions. OLAP data is organized hierarchically and stored in cubes instead of tables.) data source.
1. Decide whether you want a calculated field or a calculated item within a field.
* Use a calculated field when you want to use the data from another field in your formula.
* Use a calculated item when you want your formula to use data from one or more specific items (item: A subcategory of a field in PivotTable and PivotChart reports. For instance, the field "Month" could have items such as "January," "February," and so on.) within a field.
2. Do one of the following.
Add a calculated field
1. Click the PivotTable report.
2. On the Options tab, in the Tools group, click Formulas, and then click Calculated Field.
3. In the Name box, type a name for the field.
4. In the Formula box, enter the formula for the field.
To use the data from another field in the formula, click the field in the Fields box, and then click Insert Field. For example, to calculate a 15% commission on each value in the Sales field, you could enter = Sales * 15%.
5. Click Add.
Add a calculated item to a field
1. If items in the field are grouped, on the Options tab, in the Group group, click Ungroup.
2. Click the field where you want to add the calculated item.
3. On the Options tab, in the Tools group, click Formulas, and then click Calculated Item.
4. In the Name box, type a name for the calculated item.
5. In the Formula box, enter the formula for the item.
To use the data from an item in the formula, click the item in the Items list, and then click Insert Item (the item must be from the same field as the calculated item).
6. Click Add.
7. If you ungrouped items in step 1, regroup them if you want. For more information, see Group items in a PivotTable field
For calculated items, you can enter different formulas cell by cell.
For example, if a calculated item named OrangeCounty has a formula of =Oranges * .25 across all months, you can change the formula to =Oranges *.5 for June, July, and August.
Do the following:
1. Click a cell for which you want to change the formula.
To change the formula for several cells, hold down CTRL and click the additional cells.
2. In the formula bar (formula bar: A bar at the top of the Excel window that you use to enter or edit values or formulas in cells or charts. Displays the constant value or formula stored in the active cell.), type the changes to the formula.
If you have multiple calculated items or formulas, adjust the order of calculation by doing the following:
1. Click the PivotTable report.
2. On the Options tab, in the Tools group, click Formulas, and then click Solve Order.
3. Click a formula, and then click Move Up or Move Down.
4. Continue until the formulas are in the order that you want them to be calculated.
Are you intereted in learning more about Excel PivotTables, PivotCharts and the powerful PowerPivot for reporting? Sign up in seconds for a free 30-day trail of the KnowledgeWave Learning Site!