Exposes properties which displays icons in a [[WorksheetCell]] based on the cell's value as relative to threshold values.

This class provides the ability to display an icon inside a cell when that cell's value meets the criteria defined by the relevant [[IconCriterion]].

Each icon set contains between three and five individual icons. The number of icons defines the number of thresholds; for example, a 3-icon set implies 3 thresholds, with each threshold representing approximately 33% of the associated range. A 4-icon set provides 4 thresholds, each representing 25% of the range; a 5-icon set contains 5 thresholds with each representing 20% of the range.

Threshold ranges are pre-defined based on the number of icons in the associated set, although this can be customized using the Value property of the [[IconCriterion]] associated with that threshold.

By default thresholds are expressed as percentages; use the Value property to customize this to support a percentile rating or a specific value. How the Value property is interpreted is dependent on the ValueType property.

While the number of thresholds is always fixed at 3, 4, or 5, the icon which is displayed for a given threshold can be customized using the [[IconCriterion.icon]] property.

Hierarchy

Hierarchy (view full)

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get conditionType(): FormatConditionType
  • Returns a [[FormatConditionType]] value which identifies the type of condition for this instance.

    Returns FormatConditionType

  • get formula(): Formula
  • Returns the formula which determines the values to which this condition applies. Note: the formula should return a boolean result. When the formula is applied to cells in the region if the formula returns false then those cells will not be included in the formatting.

    See

    [[setFormula]]

    Returns Formula

  • get iconSet(): FormatConditionIconSet
  • Returns or sets a [[FormatConditionIconSet]] value which identifies the set of icons used to express this condition.

    Returns FormatConditionIconSet

  • set iconSet(a): void
  • Parameters

    Returns void

  • get isCustom(): boolean
  • Returns true if the Icon property of one or more criterion returns a value which is from a different icon set as the one returned from the [[iconSet]] property.

    Returns boolean

  • get isReverseOrder(): boolean
  • Returns or sets a boolean value indicating whether the order in which icons appear is reversed.

    Returns boolean

  • set isReverseOrder(a): void
  • Parameters

    • a: boolean

    Returns void

  • get priority(): number
  • Returns or sets a value which determines the order of evaluation when multiple conditional formatting rules exist.

    By default, conditions are evaluated in the order in which they appear within the containing collection.

    This property makes it possible to weight one condition over another, essentially overriding the condition's ordinal position within the collection.

    A lower number means a higher priority; for example, a condition with a priority of 1 is evaluated before one with a priority of 2.

    If a cell value meets more than one condition, the format defined by the first condition to be evaluated takes precedence.

    Setting the priority on one condition may cause the value of other conditions in the collection to be changed to ensure that each condition has a unique value.

    Returns number

  • set priority(a): void
  • Parameters

    • a: number

    Returns void

  • get regions(): ReadOnlyCollection$1<WorksheetRegion>
  • Returns the [[WorksheetRegion]] which identifies the cell range with which this condition is associated.

    Returns ReadOnlyCollection$1<WorksheetRegion>

  • get showValue(): boolean
  • Returns or sets a boolean value indicating whether the cell value is shown along with the icon.

    By default, the cell value is displayed along with the icon; use this property to prevent the cell value from appearing.

    Returns boolean

  • set showValue(a): void
  • Parameters

    • a: boolean

    Returns void

  • get stopIfTrue(): boolean
  • Returns or sets a boolean indicating whether additional formatting rules are evaluated if this rule evaluates to true. Applicable only in the case where the containing collection contains more than one element.

    If a cell value meets more than one condition, the format defined by the first condition takes precedence. Individual format properties are "merged" during the resolution process; for example, if one format has red borders and another has a red foreground color, a cell value which meets both conditions may be formatted with both red borders and a red foreground color.

    This property makes it possible to short-circuit the resolution process, so that no other conditional formats are applied after the first condition evaluates to true.

    Using the above example, assume StopIfTrue is set to a value of true on the conditional format with red borders, a second conditional format exists with a red foreground color, and a cell value meets both conditions. Because the StopIfTrue setting prevents additional formats from being evaluated, the cell will not show a red foreground color, whereas with StopIfTrue being set to false, it would show both red borders and a red foreground color.

    In addition to preventing subsequent conditions from being evaluated, the order in which conditions are evaluated can be controlled using the [[priority]] property.

    Returns boolean

  • set stopIfTrue(a): void
  • Parameters

    • a: boolean

    Returns void

  • get workbook(): Workbook
  • Returns a reference to the associated workbook.

    Returns Workbook

  • get worksheet(): Worksheet
  • Returns a reference to the associated worksheet.

    Returns Worksheet

Methods

  • Parameters

    • other: any

    Returns boolean

  • Returns the [[IconCriterion]] object corresponding to the specified 'index'.

    Parameters

    • index: number

      A zero-based index.

    Returns IconCriterion

  • Returns a collection which defines the criteria for this condition.

    Returns IconSetCriterionCollection

  • Sets the [[priority]] value for this rule such that it is the first condition to be evaluated. Applicable only in the case where there is more than one element contained within the associated collection.

    When multiple conditions exist in the same collection, the order in which they are evaluated has bearing on which format is applied to cells which meet those conditions.

    This method ensures that the associated condition is the first one to be evaluated.

    To make a condition the last one to be evaluated, use the [[setLastPriority]] method.

    See

    • [[priority]]
    • [[setLastPriority]]

    Returns void

  • Assigns a new [[Formula]] to the [[formula]] property. Note: the formula should return a boolean result. When the formula is applied to cells in the region if the formula returns false then those cells will not be included in the formatting.

    See

    [[formula]]

    Parameters

    • formula: string

      The string representation of the formula.

    • Optional cellReferenceMode: CellReferenceMode

      A [[CellReferenceMode]] value which specifies whether the 'formula' parameter should be interpreted as an A1 or R1C1 expression. This parameter is optional and defaults to null, in which case the [[Workbook.cellReferenceMode]] property is used.

    Returns void

  • Sets the [[priority]] value for this rule such that it is the last condition to be evaluated. Applicable only in the case where there is more than one element contained within the associated [[ConditionalFormatCollection]].

    Just as the [[setFirstPriority]] method ensures that the associated condition is evalulated first, the SetLastPriority method ensures that the associated condition is evaluated last.

    Calling this method on more than one condition essentially replaces the previously designated condition as the last one to be evaluated with this one.

    See

    • [[priority]]
    • [[setLastPriority]]
    • [[stopIfTrue]]

    Returns void

  • Replaces the existing regions with new ones

    Throws

    [[ArgumentException]] If regionAddress is invalid or contains a region from another worksheet

    Parameters

    • regionAddress: string

      A string with one or more comma separated region address

    • cellReferenceMode: CellReferenceMode

      An optional cell reference mode

    Returns void

  • 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

    • a: any
    • b: any

    Returns boolean

  • Returns void