Represents an array formula for a group of cells.

Array formulas are similar to regular formula in that they have the same grammar. However, array formulas must be set on a single region of cells only. When the array formula is applied to a region of cells, each cell's Formula property will be the array formula. The Value of each cell cannot be changed unless [[clearCellRange]] is called on the array formula or another value is applied to a region of cells which completely contains the array formula's region.

Because the array formula stores the region of the cells to which it is applied in the [[cellRange]] property, the array formula can only be applied to one region of cells.

Array formulas are created through Microsoft Excel by selecting a region of cells, entering a formula for that range, and pressing Ctrl+Shift+Enter. This causes the formula of each cell in the region to appear as follows: {=Formula}.

See the Microsoft Excel documentation for more information on array formulas.

Hierarchy

Hierarchy (view full)

Implements

  • IRegionBlockingValue

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get cellRange(): WorksheetRegion
  • Gets the cells to which the array formula is applied.

    If this is null, the formula has not yet been applied.

    The cells to which the array formula is applied.

    Returns WorksheetRegion

Methods

  • Applies the formula to all specified regions of cells.

    This method, or one of the other ApplyTo overrides must be used to set the value of a cell to a formula.

    After this method returns, the [[WorksheetCell.formula]] of all cells in all specified regions will return the formula.

    Throws

    [[ArgumentNullException]] 'regions' is null.

    Throws

    [[ArgumentException]] 'regions' has a length of 0.

    Throws

    [[ArgumentException]] Not all regions specified are from the same worksheet.

    Throws

    [[InvalidOperationException]] One or more regions specified contain array formulas or data tables which extend outside the region.

    See

    • [[applyTo]]
    • [[applyTo]]
    • [[WorksheetCell.applyFormula]]
    • [[WorksheetRegion.applyFormula]]

    Parameters

    Returns void

  • Applies the formula to the specified cell.

    This method, or one of the other ApplyTo overrides must be used to set the value of a cell to a formula.

    After this method returns, the [[WorksheetCell.formula]] of the specified cell will return the formula.

    Throws

    [[ArgumentNullException]] 'cell' is null.

    Throws

    [[InvalidOperationException]] 'cell' is part of an array formula or data table which is not confined to just the cell.

    See

    • [[WorksheetCell.value]]
    • [[applyTo]]
    • [[applyTo]]
    • [[WorksheetCell.applyFormula]]
    • [[WorksheetRegion.applyFormula]]
    • [[WorksheetRegion.applyArrayFormula]]

    Parameters

    Returns void

  • Applies the formula to the specified region of cells.

    This method, or one of the other ApplyTo overrides must be used to set the value of a cell to a formula.

    After this method returns, the [[WorksheetCell.formula]] of all cells in the specified region will return the formula.

    Throws

    [[ArgumentNullException]] 'region' is null.

    Throws

    [[InvalidOperationException]] 'region' contains an array formula or data table which extends outside the region.

    See

    • [[applyTo]]
    • [[applyTo]]
    • [[WorksheetCell.applyFormula]]
    • [[WorksheetRegion.applyFormula]]
    • [[WorksheetRegion.applyArrayFormula]]

    Parameters

    Returns void

  • Removes this array formula as the formula for the cells to which it was applied.

    After this method returns, the [[cellRange]] will be null.

    Returns void

  • Parameters

    • other: any

    Returns boolean

  • Returns number

  • Returns Base

  • Converts the formula to a string representation, similar to the string with which it was created. This uses the [[CellReferenceMode]] with which the formula was created to create cell reference strings.

    Returns string

  • Converts the formula to a string representation, similar to the string with which it was created.

    Parameters

    • cellReferenceMode: CellReferenceMode

      The cell reference mode used to create cell reference strings.

    Returns string

  • Converts the formula to a string representation, similar to the string with which it was created.

    Parameters

    • cellReferenceMode: CellReferenceMode

      The cell reference mode used to create cell reference strings.

    • culture: string | CultureInfo

      The culture used to generate the formula string.

    Returns string

  • Determines whether two [[Formula]] instances are equal using the specified cell reference mode. This essentially performs a case-insensitive string comparison, ignoring the white space in the formula.

    Parameters

    • formulaA: Formula

      The first Formula to compare.

    • formulaB: Formula

      The second Formula to compare.

    • cellReferenceMode: CellReferenceMode

      The cell reference mode to use when comparing the two formulas.

    Returns boolean

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns number

  • Parses the specified formula value and returns the array formula which was created from it.

    Throws

    [[ArgumentNullException]] 'value' is null or empty.

    Throws

    [[InvalidEnumArgumentException]] 'cellReferenceMode' is not defined in the [[CellReferenceMode]] enumeration.

    Throws

    [[FormulaParseException]] 'value' is not a valid formula.

    Parameters

    • value: string

      The string which defines the array formula to parse.

    • cellReferenceMode: CellReferenceMode

      The mode used to interpret cell references in the array formula.

    Returns ArrayFormula

  • Parses the specified formula value and returns the array formula which was created from it.

    Throws

    [[ArgumentNullException]] 'value' is null or empty.

    Throws

    [[InvalidEnumArgumentException]] 'cellReferenceMode' is not defined in the [[CellReferenceMode]] enumeration.

    Throws

    [[InvalidEnumArgumentException]] 'fileFormat' is not defined in the [[WorkbookFormat]] enumeration.

    Throws

    [[FormulaParseException]] 'value' is not a valid formula.

    Parameters

    • value: string

      The string which defines the array formula to parse.

    • cellReferenceMode: CellReferenceMode

      The mode used to interpret cell references in the array formula.

    • fileFormat: WorkbookFormat

      The file format to use when parsing the array formula. This will be used to determine certain limits which are format dependant.

    Returns ArrayFormula

  • Parses the specified formula value and returns the array formula which was created from it.

    Throws

    [[ArgumentNullException]] 'value' is null or empty.

    Throws

    [[InvalidEnumArgumentException]] 'cellReferenceMode' is not defined in the [[CellReferenceMode]] enumeration.

    Throws

    [[InvalidEnumArgumentException]] 'fileFormat' is not defined in the [[WorkbookFormat]] enumeration.

    Throws

    [[FormulaParseException]] 'value' is not a valid formula.

    Parameters

    • value: string

      The string which defines the array formula to parse.

    • cellReferenceMode: CellReferenceMode

      The mode used to interpret cell references in the array formula.

    • fileFormat: WorkbookFormat

      The file format to use when parsing the array formula. This will be used to determine certain limits which are format dependant.

    • culture: string | CultureInfo

      The culture used to parse the formula.

    Returns ArrayFormula

  • Parses the specified formula value and returns the array formula which was created from it.

    Throws

    [[ArgumentNullException]] 'value' is null or empty.

    Throws

    [[InvalidEnumArgumentException]] 'cellReferenceMode' is not defined in the [[CellReferenceMode]] enumeration.

    Throws

    [[FormulaParseException]] 'value' is not a valid formula.

    Parameters

    • value: string

      The string which defines the array formula to parse.

    • cellReferenceMode: CellReferenceMode

      The mode used to interpret cell references in the array formula.

    • culture: string | CultureInfo

      The culture used to parse the formula.

    Returns ArrayFormula

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Returns void