Represents a formula for a cell or group of cells.
Constructors
Section titled "Constructors"Formula
new Formula(a: number, b: number, c: FormulaType): Formula Returns Formula
Properties
Section titled "Properties"$t: Type Methods
Section titled "Methods"applyTo
Section titled "applyTo"Applies the formula to all specified regions of cells.
applyTo(regions: WorksheetRegion[]): void Parameters
- regions:
WorksheetRegion[]The regions of cells to apply the formula to.
Returns void
toString
Section titled "toString"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.
toString(): string Returns string
areEqual
Section titled "areEqual"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.
areEqual(formulaA: Formula, formulaB: Formula, cellReferenceMode: CellReferenceMode): boolean Parameters
- formulaA:
FormulaThe first Formula to compare.
- formulaB:
FormulaThe second Formula to compare.
- cellReferenceMode:
CellReferenceModeThe cell reference mode to use when comparing the two formulas.
Returns boolean
parse
Section titled "parse"Parses the specified formula value and returns the formula which was created from it.
parse(value: string, cellReferenceMode: CellReferenceMode): Formula Parameters
- value:
stringThe string which defines the formula to parse.
- cellReferenceMode:
CellReferenceModeThe mode used to interpret cell references in the formula.
Returns Formula
staticInit
Section titled "staticInit"staticInit(): void