| | Product Information Help and How-to Training Templates Related Products and Technologies Support and Feedback Technical Resources Additional Resources | Warning: You are viewing this page with an unsupported Web browser. This Web site works best with Microsoft Internet Explorer 6.0 or later, Firefox 1.5, or Netscape Navigator 8.0 or later. Learn more about supported browsers.
Create your own formula in a PivotTable or PivotChart report
Source data (source data: The list or table that's used to create a PivotTable or PivotChart report. Source data can be taken from an Excel list or range, an external database or cube, or another PivotTable report.) from 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.) databases doesn't allow you to create formulas.
- Decide whether you want a calculated field (calculated field: A field in a PivotTable report or PivotChart report that uses a formula you create. Calculated fields can perform calculations by using the contents of other fields in the PivotTable report or PivotChart report.) or a calculated item (calculated item: An item within a PivotTable field or PivotChart field that uses a formula you create. Calculated items can perform calculations by using the contents of other items within the same field of the PivotTable report or PivotChart report.) 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.
- Do one of the following. For best results in a PivotChart report (PivotChart report: A chart that provides interactive analysis of data, like a PivotTable report. You can change views of data, see different levels of detail, or reorganize the chart layout by dragging fields and by showing or hiding items in fields.), work in the associated PivotTable report (associated PivotTable report: The PivotTable report that supplies the source data to the PivotChart report. It is created automatically when you create a new PivotChart report. When you change the layout of either report, the other also changes.), where you can see the individual data values that your formula calculates.
Add a calculated field
- Click the report.
- On the PivotTable
toolbar (toolbar: A bar with buttons and options that you use to carry out commands. To display a toolbar, press ALT and then SHIFT+F10.), click PivotTable or PivotChart, point to Formulas, and then click Calculated Field.
- In the Name box, type a name for the field.
- 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%.
- Click Add, and then click OK.
Add a calculated item to a field
- If items in the field are grouped, right-click each group, point to Group and Outline on the shortcut menu, and then click Ungroup.
- Click the field where you want to add the calculated item.
- On the PivotTable
toolbar (toolbar: A bar with buttons and options that you use to carry out commands. To display a toolbar, press ALT and then SHIFT+F10.), click PivotTable or PivotChart, point to Formulas, and then click Calculated Item.
- In the Name box, type a name for the calculated item.
- 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).
- Click Add, and then click OK.
- If you ungrouped items in step 1, regroup them if you want.
- For calculated items, you can enter different formulas cell by cell.
- If you have multiple calculated items or formulas, adjust the order of calculation.
Note When you add a formula to a PivotChart report or its associated PivotTable report, some chart formatting may be lost.
|