Hi - The macro solution is probably the most efficient. But I can suggest a workaround…
If the color is applied by styles, and if the number of styles is limited, you can use “unused” properties of styles to differentiate them.
FilterByStyle.ods
In the example attached the format of the styles are different.
- Yellow: negative number in yellow
- Orange: unprotected style
- Red: the thousands separator is enabled
- Green: negative numbers are in brackets
These attributes can be tested by the CELL function with a formula such:
=IF(CELL("COLOR";A3)=1;"Yellow";IF(CELL("PROTECT";A3)=0;"Orange";IF(CELL("FORMAT";A3)=",0";"Red";IF(CELL("PARENTHESES";A3)=1;"Green";"Default"))))