Function/Formula for a cell response from 5 columns of data


I am trying to write a function/formula that will say: If columns are green in columns F, H, J, L and N then put YES in R/ or alternatively, if any collumns in F, H, J, L and N are red then put NO in R

F, H, J, L and N have macro attached to them that identifies the cell colour, (to the right). I cannot get a function/formula in R to figure this out. is there a way to do this?




There are two ways to colour a cell in Excel (both for fill and font colour). One is to set a colour permanently. The other is conditional formatting, where the permanent colour is changed to something else when a condition is met.

In order to take action depending upon the permanent colour of a cell you would require VBA, perhaps a User Defined Function (UDF) that you can call from the worksheet. The difficulty here is to ensure that the colour set by the user is actually the same that the UDF looks for. There are ways to overcome this but perhaps you already get an inkling that colour isn't the best way to differentiate.

Indeed, if the colour is applied using CF you wouldn't look at the colour at all. Instead, you would apply the same logic that sets the CF to counting the cells that meet CF's criteria.

Of course, you can apply that exact same logic also to permanently coloured cells. Just why are your cells green? Put that logic into a formula.


Answer the Question

You must create an account to use the forum. Create an Account or Login