How do I use the background color of a cell as an argument in a function.

New Contributor

I need to get an "OK" if the background color in a cell is green or a "NO" if not.

Something like:
IF('Background Color in cell V3=green'; "OK"; "NO")
How do I do that correctly in Excel.

6 Replies


That's with VBA, formulae don't work with cell properties like color.

@Sergei Baklan 

Thank you very much. Then I will not struggle with formulae in Excel further. I'll check out VBA and learn. 

Merry Christmas and Happy New Year

May I ask how the cell is getting that color? If it is getting a color through conditional formatting then the same condition/formula used to get the color can be used. If it is based on manual entry (i.e. someone manually sets the color) then I suggest you change the set up so they enter a value instead (maybe using 'helper' cells/columns). The color can then automatically use those manual entries to create the colors AND you can use those entries in your formulas.
Hey m tarler
I set the colors manually. Green for bill payed and red for not payed. I have a page where I type in ID for tenant, and then I would like a list of OK for paid rent and NO for unpaid.
I'll take a look as soon as I can. thank you.


Excluding VBA for the moment the minimum typing can be achieved with 0 (unpaid) or 1 (paid).  The values can be presented as text by number formatting and the cell colour changed using conditional formatting  If preferred, status can be selected from a dropdown.


Using VBA, event handlers could toggle the settings of selected cells.


To Peter Bartholomew
This sounds right. I'll try it very soon. Thank you.