Irritatingly frequently I encounter a request which basically boils down to â€œI have this amazingly complicated excel spreadsheet Iâ€™m using to stop the company from going bankrupt, can you make yourÂ applicationÂ produce it?â€. Â So I bravely dive into it and find 96 tabs and graphs and the what not. I am terrified that so much of the business world relies on spreadsheets of this sort but my nightmarish fears are not the subject of this blog. Â Well not today.
I make use of theÂ absolutelyÂ fantastic excel library EPPlus. In todayâ€™s nightmare I was to create a databar. This is a special sort of conditional formatting which basically creates a bar inside a cell.Â
The length of the bar is calculated based on the range between the largest and smallest values in the range. Arenâ€™t they pretty?
The latest version of EPPlus adds support for conditional formatting and you too can create these sorts of spreadsheets programatically.
Basically all you do is select the range you want and assign the conditional formatting of type databar to it. As far as I can tell there is no support yet for solid fill bars.