Sets or returns the type of calculation used to summarize a data field. The available types are determined by PivotTableField.SummarizeByType.

 public SummarizeByType SummarizeBy{ get; set; }
Public Property SummarizeBy() As SummarizeByType

          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Open(@"C:\MySpreadsheet.xlsx");
          Worksheet ws = wb.Worksheets[0];
          DataField df = ws.PivotTables[0].DataFields[0];
          df.SummarizeBy = PivotTableField.SummarizeByType.Average;
        

          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.Open("C:\MySpreadsheet.xlsx")
          Dim ws As Worksheet = wb.Worksheets(0)
          Dim df As DataField = ws.PivotTables(0).DataFields(0)
          df.SummarizeBy = PivotTableField.SummarizebyType.Average
        

DataFields are set to Count for string values and Sum for numerical values by default.

This property cannot be set on CalculatedFields and will return SummarizeByType.Sum. You can check if a PivotField is calculated field with the IsCacluatedField Property