# ExcelPivotCalculatedField

Describes a formula-backed pivot cache field to author.

Class 

`OfficeIMO.Excel`

**Namespace**

`OfficeIMO.Excel`

**Assembly**

`OfficeIMO.Excel`

**Source revision**

`273d35d5ba8a` with working tree changes

**Source**

[ExcelPivotCalculatedField.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotCalculatedField.cs#L9)

**Modifiers**

sealed

Describes a formula-backed pivot cache field to author.

## Inheritance

- object
- ExcelPivotCalculatedField

## Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Property [ExcelPivotTableOptions.CalculatedFields](/api/excel/officeimo-excel-excelpivottableoptions/#property-calculatedfields)

Filter members 

Show inherited

## Constructors

`public ExcelPivotCalculatedField(string name, string formula, string? caption = null, uint? numberFormatId = null, string? numberFormat = null)` [#](#constructor-ctor-string-string-string-nullable-system-uint32-string)

[ExcelPivotCalculatedField.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotCalculatedField.cs#L9)

Creates a calculated pivot field.

Parameters

**name string required**

**formula string required**

**caption string? = null optional**

**numberFormatId uint? = null optional**

**numberFormat string? = null optional**

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string Name { get; }` [#](#property-name)

[ExcelPivotCalculatedField.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotCalculatedField.cs#L18)

Gets the calculated field name.

`public string Formula { get; }` [#](#property-formula)

[ExcelPivotCalculatedField.cs:21](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotCalculatedField.cs#L21)

Gets the calculated field formula.

`public string? Caption { get; }` [#](#property-caption)

[ExcelPivotCalculatedField.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotCalculatedField.cs#L24)

Gets the optional display caption.

`public uint? NumberFormatId { get; }` [#](#property-numberformatid)

[ExcelPivotCalculatedField.cs:27](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotCalculatedField.cs#L27)

Gets the optional built-in/custom number format id.

`public string? NumberFormat { get; }` [#](#property-numberformat)

[ExcelPivotCalculatedField.cs:30](https://github.com/EvotecIT/OfficeIMO/blob/273d35d5ba8ab8ce3f6f1238631241c0cea26d14/OfficeIMO.Excel/ExcelPivotCalculatedField.cs#L30)

Gets the optional number format code to add to the workbook styles.

<!-- PowerForge markdown artifact sha256:2066D37015B2240B0502FD183F5B4A4C9AFA54C4C3A23621B0C0F38AC188E3E8 -->
