Skip to content

Three Icon Set example

Mats Alm edited this page Nov 10, 2026 · 4 revisions

This page has moved. The current version of this page is at https://epplussoftware.com/docs/styling/conditional-formatting/three-icon-set-example/. The EPPlus documentation is no longer updated in this wiki; please use the EPPlus guides and update your bookmarks.

Here is a Conditional Formatting example where we add a ThreeIconSet 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

⌂ 换网址