Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
When you create a pivot table based on known data, you find that the data in it is not what you want. The data you want is the combination of these original data. For example, you need to add, subtract, multiply and divide the original data before you want the data. At this time, you need to build a calculated field and set the corresponding formula for calculation. Then perform some statistics and other operations on the calculated field.
Insert a calculated field in a PivotTable in Excel, follow these steps:


Please see the following sample code. The code first sets the original data and creates a pivot table. Then create the calculated field according to the existing PivotField in the pivot table and add the calculated field to the data area. Finally, it saves the workbook in output XLSX format. After executing the example code, a pivot table with calculated field is added to the worksheet.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.