Forum Discussion
Counting function depending on color
- JMB17Jan 26, 2021Bronze Contributor
Use option 24 for the get.cell method in the youtube video. However, note that changing the font color will most likely not trigger any excel events that are practical to use to trigger the worksheet to recalculate/update, so your total may not update right away (but you can force the worksheet to calculate).
https://www.mrexcel.com/board/threads/info-only-get-cell-arguments.20611/
If possible, I would suggest making some rules for how the cell fonts should be colored and using those in conditional formats. Then, use the same logic/rules in a countif(s) formula.
- NikolinoDEJan 25, 2021Platinum Contributor
Here is a small example with red numbers
I would be happy to know if I could help.
Nikolino
I know I don't know anything (Socrates)
- daurel67Jan 26, 2021Copper ContributorWhen I change the color of the number it no longer makes the addition.
And anyway, I need to count them, not gather them.- Riny_van_EekelenJan 26, 2021Platinum Contributor
daurel67 From the example file one could deduce that you are trying to count the number of week-end days in a given calendar month. If so, why not replace the numbers 1 to 31 with real dates and use some of Excel's date functions to do the colouring and counting for you. See Picture below and example attached. Just a thought. Kindly ignore if this is not the case.