# Microsoft Office Application Help - Excel Help forum > For Other Platforms(Mac, Google Docs, Mobile OS etc) >  >  sum cell values by criteria there cell color (Excel Mac 2011)

## Opi12

In A2:A50 i have different numerical values. I would like to sum all cells that has been colored red. Is this possible? Thankful for help

----------


## NickyC

Hi
It's easy, except you need to tell your formula what you mean by "Red"! there are thousands of RGB combinations that look "red"

if you are using the microsoft default red  RGB(255,0,0) then this user-defined formula should work (or if you know the RGB of the colour your are using, use this instead of FontColour = RGB(255, 0, 0))




```
Please Login or Register  to view this content.
```


if not, try this formula. The first cell to enter has the font colour you want to count, the range includes the cells whose values you want to sum. So to count cells in B1:F1 with the same font colour as A1, Your formula will look like this

=Function colours_add_match_first(A1,B1:F1) 




```
Please Login or Register  to view this content.
```

----------


## JosephP

you really need to make those functions volatile. they still won't react to simply changing a cell color but at least they will update when the workbook calculates ;-)

of course not using color as data is better

----------


## unikonfire

Hey, I am currently trying this but can't seem to let it work.

So I need to create a macro with that code, and make sure the extension is macro-enabled.

That's what I've done but I can't seem to manage to make this work unfortunately..

----------

