Color is not data. Excel does not have a function for that. What is the logic for the cells to have a specific color? If you use conditional formatting to set the color of cells, you need to apply logic rules. You can use the same logic rules for calculations. But if you manually format a cell to a specific color that cannot be used in a formula.