Discussion Locked

Excel 2000 colors

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Is there any way to add, subtract, multiply or divide numbers in a Excel spreadsheet based on the color of the numberin the cell? For example, I have a column of numbers, some black, some red and some blue. I want to have 3 sum cells as the bottom, a red total, a blue total and a black total. Is there any way to do this strictly based on the color of the cell contents? Thanks

9 replies

by joescalia

The first link is not dead I just tried it and it works. Have you tried to type in??? By pasting you have to move the words in formuls together......

by jonbg1

You could try using a simple VBA function:

Function FontColor(Cell As Excel.Range) As Integer
FontColor = Cell.Font.ColorIndex
End Function

Use the function to find out the values of the colors you are using.

Set up a "color" column for each of the colors you want to to sum.

In each "color" column, use an IF function comparing the FontColor function to the value of that color to extract or not extract the numbers with that color from the original column. Sum each color column.Create your final sums by referring to the sum of each color column.

This discussion is closed to new replies.