Skip to content

Three Icon Set example

Mats Alm edited this page Oct 26, 2023 · 3 revisions

Here is a Conditional Formatting example where we add a Three Icon Set rule. Let's start with how the result will look like:

CondFormatting5

Here is how this rule will look like when edited in Excel:

CondFormatting4

And here is the code to achieve it with EPPlus:

// Use traffic light icons
var cfRule = sheet.ConditionalFormatting.AddThreeIconSet(sheet.Cells["D7:D13"], eExcelconditionalFormatting3IconsSetType.TrafficLights2);
cfRule.Icon2.Type = eExcelConditionalFormattingValueObjectType.Formula;
cfRule.Icon2.Formula = "$E$2 * ($E$4 +1)";
cfRule.Icon3.Type = eExcelConditionalFormattingValueObjectType.Formula;
cfRule.Icon3.Formula = "$E$3";

Back to Conditional Formatting

EPPlus wiki

Versions

Worksheet & Ranges

Styling

Import/Export data

Formulas and filters

Charts & Drawing objects

Tables & Pivot Tables

VBA & Protection

Clone this wiki locally