[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IAboveAverage

IAboveAverage Interface

Represents a conditional formatting rule that evaluates cell values by comparing them with the range average or a standard deviation threshold.

Use this interface to configure a rule that matches values above average, below average, equal to or above average, equal to or below average, above the standard deviation, or below the standard deviation.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface IAboveAverage
Public Interface IAboveAverage
Examples
worksheet.Range["A1:A5"].Value = new object[,] {{10}, {20}, {30}, {40}, {50}};
IAboveAverage format = worksheet.Range["A1:A5"].FormatConditions.AddAboveAverage();
format.Interior.Color = Color.Yellow;
format.AboveBelow = AboveBelow.BelowAverage;

Properties

Name Description
AboveBelow

Returns one of the constants of the AboveBelow enumeration, specifying how the conditional formatting rule compares cell values with the range average or a standard deviation threshold.

Use this property to determine whether the rule evaluates values that are above average, below average, equal to or above average, equal to or below average, above the standard deviation, or below the standard deviation.

AppliesTo

Gets or sets a range object specifying the cell range to which the formatting rule is applied.

Use this property to retrieve the target range of the current above-average conditional formatting rule.

Borders

Gets an instance of IBorders which represents the borders of this conditional format.

Use the returned IBorders object to configure the border style that is applied when this above-average conditional formatting rule evaluates to true.

Font

Gets an instance of IFont which represents the font of this conditional format.

Interior

Gets an instance of IInterior which represents the background color of this conditional format.

Use the returned IInterior object to access or modify the fill settings applied when the above-average conditional formatting rule is in effect.

NumStdDev

Gets or sets the numeric standard deviation for an AboveAverage object.

Use this property to get or set the standard deviation value currently assigned to the above average conditional formatting rule.

NumberFormat

Gets or sets the number format applied to a cell if the conditional formatting rule evaluates to true.

Use this property to retrieve the format code currently configured for an above-average conditional formatting rule.

Priority

Gets or sets the priority value of the conditional formatting rule.

The priority determines the order of evaluation when multiple conditional formatting rules exist in a worksheet.

When setting the priority, the value must be a positive integer between 1 and the total number of conditional formatting rules on the worksheet. The priority must be a unique value for all rules on the worksheet, so changing the priority for the specified conditional formatting rule may cause the priority value of the other rules on the worksheet to be shifted.

StopIfTrue

Gets or sets a boolean value that determines whether additional formatting rules on the cell should be evaluated if the current rule evaluates to true.

Type

Gets the type of this conditional format.

For an IAboveAverage rule, this property returns AboveAverageCondition.

Methods

Name Description
Delete()

Deletes this conditional format.

Use this method to remove an above-average conditional formatting rule that was previously added to a range.

FromJson(string)

Generates the conditional format from the JSON string.

Use this method to restore the settings of an above average conditional format from a JSON string, such as one generated by ToJson().

SetFirstPriority()

Moves this conditional formatting rule to the highest evaluation priority among all conditional formatting rules on the worksheet.

Use this method to move the current conditional formatting rule based on the average or standard deviation to the highest evaluation priority among the conditional formatting rules on the same worksheet.

SetLastPriority()

Moves this conditional formatting rule to the lowest evaluation priority among all conditional formatting rules on the worksheet.

Use this method to move the current conditional formatting rule based on the average or standard deviation to the lowest evaluation priority among the conditional formatting rules in the worksheet.

ToJson()

Generates a JSON string from the conditional format.

The returned string contains the serialized state of this IAboveAverage rule and can be used with FromJson(string) to restore the conditional format.