Conditional formatting based on values in A1:A6

kpierce

Board Regular
Joined
Jun 21, 2010
Messages
76
Hello -
I have a spreadsheet where A1 thru A6 have values of R,Y,G,N/A
Example:
A1 = R
A2 = Y
A3 = G
A4 = Y
A5 = G
A5 = Y

I want to create a formula that will automatically update B1 based on the following criteria:

If there are 2 or more Y, then B1 will be Y
If there are 2 or more R, then B1 will be R
otherwise B1 will be G

If have messed around with COUNTIF, but have had no luck. Is there an easy way to put this into a formula?

thanks in advance for all the help.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hello -
I have a spreadsheet where A1 thru A6 have values of R,Y,G,N/A
Example:
A1 = R
A2 = Y
A3 = G
A4 = Y
A5 = G
A5 = Y

I want to create a formula that will automatically update B1 based on the following criteria:

If there are 2 or more Y, then B1 will be Y
If there are 2 or more R, then B1 will be R
otherwise B1 will be G

If have messed around with COUNTIF, but have had no luck. Is there an easy way to put this into a formula?

thanks in advance for all the help.
What should happen if there are 2 Y and 2 R (if that's even a possibility)?
 
Upvote 0
if there are 2 RED and 2 YELLOWs then it needs to be RED.

This is for a simply dashboard board so they colors progress from Green, Yellow, Red so if there are Reds that trumps Yellow...

I hope that makes sense.

thanks
 
Upvote 0
if there are 2 RED and 2 YELLOWs then it needs to be RED.

This is for a simply dashboard board so they colors progress from Green, Yellow, Red so if there are Reds that trumps Yellow...

I hope that makes sense.

thanks
Try this...

=IF(COUNTIF(A1:A6,"R")>=2,"R",IF(COUNTIF(A1:A6,"Y")>=2,"Y","G"))
 
Upvote 0
I am going to post one more question... I hope everyone does not feel I am becoming a pain...

thanks in advance.
 
Upvote 0
Just realized there is a wrinkle in my logic. If there is atleast one R and atleast one Y, then it needs to be Y, right now it stays G..

Any thoughts?
 
Upvote 0
Just realized there is a wrinkle in my logic. If there is atleast one R and atleast one Y, then it needs to be Y, right now it stays G..

Any thoughts?
Do you mean OR...

...If there is at least one R OR atleast one Y...

Or, do you really mean AND?
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top