# Conditional Formatting

Conditional formatting highlights useful data in rows or columns of a worksheet that meet specific criteria such as cell values, unique cell values, etc.

## Content

In order to highlight important information in rows or columns of a worksheet, DsExcel .NET allows users to create conditional formatting rules for individual cells or a range of cells based on cell values. If the format condition matches with the cell value, it is assumed as true and the cell is formatted as per the specified rule.
For instance, let us assume you want a cell or a range of cells to appear in italics when the value entered in them is lower than 90. To accomplish this, you would apply a conditional formatting rule that will change the format of the cell as soon as the condition is met. Other cells will appear in general format which is the default format of the cells in a spreadsheet.
You can apply conditional formatting in individual cells or a range of cells using rules or conditional operators. The set of conditional formatting rules for a range is represented with the [FormatConditions property](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.IRange.FormatConditions.html) of the [IRange interface](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.IRange.html).

## Pictures in Cell Conditional Formatting Support

In addition to standard cell values, DsExcel .NET also supports conditional formatting for cells that contain pictures (rich data type). The following conditional formatting rule types are supported for pictures in cells:

| Format Type | Description |
| ----------- | ----------- |
| Cell Value Equals / Cell Value Not Equals | Compares the complete RichData value ([AltText](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.CellPicture.AltText.html) and [ImageData](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.CellPicture.ImageData.html) must both match). |
| Text Contains / Text Does Not Contain | Operates on the [AltText](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.CellPicture.AltText.html) string component only. |
| Duplicate Values / Unique Values | Compares the complete RichData value ([AltText](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.CellPicture.AltText.html) and [ImageData](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.CellPicture.ImageData.html) must both match). |
| Blanks | Picture cells are not considered blank. |
| Errors | Picture cells are not considered errors. |
| Formula | Depends on the result of the formula evaluation. |

Shared below is a list of conditional formatting rules that can be applied in a worksheet.

* [Cell Value Rule](/document-solutions/dot-net-excel-api/docs/online/Features/ApplyConditionalFormatting/AddCellValueRule)
* [Date Occurring Rule](/document-solutions/dot-net-excel-api/docs/online/Features/ApplyConditionalFormatting/AddDateOccurringRule)
* [Average Rule](/document-solutions/dot-net-excel-api/docs/online/Features/ApplyConditionalFormatting/AddAverageRule)
* [Color Scale Rule](/document-solutions/dot-net-excel-api/docs/online/Features/ApplyConditionalFormatting/AddColorScaleRule)
* [Data Bar Rule](/document-solutions/dot-net-excel-api/docs/online/Features/ApplyConditionalFormatting/AddDataBarRule)
* [Top Bottom Rule](/document-solutions/dot-net-excel-api/docs/online/Features/ApplyConditionalFormatting/AddTopBottomRule)
* [Unique Rule](/document-solutions/dot-net-excel-api/docs/online/Features/ApplyConditionalFormatting/AddUniqueRule)
* [Icon Sets Rule](/document-solutions/dot-net-excel-api/docs/online/Features/ApplyConditionalFormatting/AddIconSetsRule)
* [Expression Rule](/document-solutions/dot-net-excel-api/docs/online/Features/ApplyConditionalFormatting/AddExpressionRule)

If you want to delete the formatting rule applied to the cell range in a worksheet, you can do it by using the [Delete method](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.IFormatCondition.Delete.html) of [IFormatCondition interface](/document-solutions/dot-net-excel-api/api/online/DS.Documents.Excel/GrapeCity.Documents.Excel.IFormatCondition.html)