How to set the criteria to sumif only cells that are highlighted

Copper Contributor

what do you enter as the criteria in the sumif function when you want to sum only cells that are highlighted

2 Replies

@PeoriaBallet 

If the cells are highlighted using conditional formatting, refer to the condition(s) of the conditional formatting rule instead of to the cell color.

If the cells have been colored manually, you'll need to use VBA: see for example http://www.cpearson.com/excel/colors.aspx 

@Hans Vogelaar Thank you very much for you prompt assistance.