drop down list formula

E

Eric

Basically what I'm trying to do is I have cells G18 through G32 that have
drop down values of "Green", "Yellow", and "Red". I have another cell (let's
call it C7) that I want to display one of these colors as a summary cell. For
example if all the G cells are "Green" then C7 is "Green", but if any of the
G cells is either "Yellow" or "Red" then C7 will display as either "Yellow"
or "Red" ("Red" if both are present). Any help with this formula would be
welcome. Thanks.
 
T

T. Valko

It's not real clear what you want...

Is this what you want:

If *all* cells are the same color then that color

If *any* cell is Red then Red

What if some cells are Green and some cells are Yellow?

Will all cells contain some color? Any empty cells?
 
E

Eric

If all cells are green then green.
If any cells yellow or red then yellow or red.
If there is a mix of all three then red (or if just yellow and green then
yellow).
Green is the lowest priority then yellow then red.
There are no empty cells.
I hope this clarifies what I need.

Thank you
 
P

Paul C

Eric,

I have a worksheet that does exactly this.

If you put a conditional format on C7 with 3 conditions this will work.

Condition 1
Formula Is =COUNTIF($G$18:$G$32,"Red")>0
Select the Red Fill as the format

Condition 2
Formula Is =COUNTIF($G$18:$G$32,"Yellow")>0
Select the Yellow Fill as the format

Condition 3
Formula Is =COUNTIF($G$18:$G$32,"Green")>0
Select the Green Fill as the format

Paul C
 
T

T. Valko

I hope this clarifies what I need.

Well, this is still confusing:
If any cells yellow or red then yellow or red.

So, should that be Yellow or Red? If all cells are either Yellow or Red what
determines if the result is Yellow or Red?
 
E

Eric

It's a progressive kind of result. If all are green then the result is green
(but all must be green). If even a single cell is yellow then result is
yellow (if there is no red). If even a single cell is red then result is red
regardless of any other cell.
 
T

T. Valko

OK, that clears it up pretty much:

=IF(COUNTIF(G18:G32,"Red"),"Red",IF(COUNTIF(G18:G32,"Yellow"),"Yellow","Green"))
 
E

Eric

These were very helpful as well. Couldn't find the conditionals in '07 for a
minute but tracked it down. :) Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top