SOLVED

how to create a function that uses two colour criteria to generate text

Copper Contributor

Hi!

 

I need help creating a function that returns text by giving a combination of two colors.

 

For example, if I pick two cells, one red and one green, I want to get BAD. If both cells are green, then I want to get GOOD.

 

Can anyone help?

 

Thanks

 

Capturar_EXCEL.JPG

7 Replies

@aigr_pt 

Are the colors set manually or are they the result of conditional formatting?

Hi there!
They resolt from condicional formatting

@aigr_pt 

If so you don't need VBA to pick-up colors, logic of conditional formatting could be used in formula.

best response confirmed by allyreckerman (Microsoft)
Solution

@aigr_pt

What Sergei writes...

Let's say a cell is green if the value is >=5 and red if it is <5

You can use the formula

 

=IF(AND(cell1>=5, cell2>=5), "GOOD", "BAD")

@aigr_pt 

1) What are the conditional formatting rules?

2) Which cells do you want to look at?

Sorry! My mistake!!! It works!!! Thank you so much!
1 best response

Accepted Solutions
best response confirmed by allyreckerman (Microsoft)
Solution

@aigr_pt

What Sergei writes...

Let's say a cell is green if the value is >=5 and red if it is <5

You can use the formula

 

=IF(AND(cell1>=5, cell2>=5), "GOOD", "BAD")

View solution in original post