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
rangeXlsxCellRangeThe cells.
aboveboolWhether values above the average are formatted (below otherwise).
orEqualboolWhether a value equal to the average is formatted too.
formatXlsxDifferentialStyleWhat the rule changes.
Returns
- XlsxConditionalFormat
The rule.
Exceptions
- ArgumentException
The format sets nothing.
- InvalidOperationException
The sheet is not a worksheet.