Excel allows defined functions to be executed in Worksheets by a user. Instead of a formula based on the color of a cell, it is better to write a function that can detect the color of the cell and ...
Stop hunting through cells manually; Excel already knows where your formula broke.
Most spreadsheet problems come from static cell ranges—Excel tables replace them with dynamic, self-managing data structures.