If everything is OK = green otherwise red

Camille -  
jee pee Posted messages 31903 Registration date   Status Modérateur Last intervention   -
Hello,

I’m still new to Excel and I would like to create a function to show that if all my columns are "OK", then it should be green, and if "NOK", the result should be red (in percentage would be ideal).

Let me explain
For example, in column C where the result is located
From column D to N are the results (choice between OK and NOK)
If everything is OK, I would like it to show 100% in green
If everything is not OK, then it should be red with the remaining percentage before reaching 100% i.e. everything is OK

I hope this is clear enough ^^

If a kind soul could help me, I would be very grateful

Best regards

1 réponse

jee pee Posted messages 31903 Registration date   Status Modérateur Last intervention   9 945
 
Hello,

In C1 you can put a formula for calculating the %, with a cell format %:
=COUNTIF(D1:N1,"OK")/COUNTIF(D1:N1,"*")


Then you create conditional formatting in C1:
- highlight rules/equal to/100% ==> green
- highlight rules/less than/100% ==> red

and you copy down the cell C1

0