Forum Discussion
paul-cas1962
Aug 25, 2021Copper Contributor
Return a value based upon a cell colour
I need to assign three different values based upon three different cell colours
- Aug 25, 2021
The ASAPCELLCOLORINDEX function returns the fill color index of a cell. You can use this in an IFS or SWITCH formula.
HansVogelaar
Aug 25, 2021MVP
Have the cell colours been applied directly, or are they the result of conditional formatting?
- Mmaayy999Jun 15, 2022Copper Contributor
Hi HansVogelaar , is there any functions work for the color define by conditional format? I want to return header for the cell first filled with red in a row, but solution I find only work for the color defined directly, not work for conditional format... thanks in advance...
- HansVogelaarJun 15, 2022MVP
The problem is that the actual formatting applied by conditional formatting is not available in a cell formula.
Instead of referring to the color, you'll have to use the conditions behind the conditional formatting rules. For example, if a cell is colored red if its value is greater than 100, your formula would have to search for values greater than 100.
- Mmaayy999Jun 15, 2022Copper ContributorThank you a lot, but the condition of the format is dynamic, which sums different range based on the cell index..😔
- paul-cas1962Aug 25, 2021Copper ContributorThey have been applied directly
- HansVogelaarAug 25, 2021MVP
You need custom functions for that.
You can either copy them from Color Functions In Excel or use ASAP Utillities (free for personal use)
- paul-cas1962Aug 25, 2021Copper Contributor
Is there a function in ASAP Utilities that will enable me to return a value based upon the colour of another cell? I can't find such function.