Function Property

Applies To

PivotField object.

Description

Returns or sets the function used to summarize the pivot field (data fields only). Can be one of the following XlConsolidationFunction constants: xlAverage, xlCount, xlCountNums, xlMax, xlMin, xlProduct, xlStDev, xlStDevP, xlSum, xlVar, or xlVarP. Read/write Long.

Example

This example sets the Sum of 1994 field in PivotTable1 to use the SUM function.

ActiveSheet.PivotTables("PivotTable1") _
    .PivotFields("Sum of 1994").Function = xlSum