Table of Contents

Method AddAverage

Namespace
DocWright.Spreadsheet
Assembly
DocWright.Spreadsheet.dll

AddAverage(XlsxCellRange, bool, bool, XlsxDifferentialStyle)

Adds a rule that formats values above or below the range's average.

public XlsxConditionalFormat AddAverage(XlsxCellRange range, bool above, bool orEqual, XlsxDifferentialStyle format)

Parameters

range XlsxCellRange

The cells.

above bool

Whether values above the average are formatted (below otherwise).

orEqual bool

Whether a value equal to the average is formatted too.

format XlsxDifferentialStyle

What the rule changes.

Returns

XlsxConditionalFormat

The rule.

Exceptions

ArgumentException

The format sets nothing.

InvalidOperationException

The sheet is not a worksheet.