Nested IF (AND< OR, XOR) Problem

Brampton76

New Member
Joined
Nov 14, 2008
Messages
35
Good Evening,

I have a range of cells that are filled with text that is either Green, Amber or Red. If all the cells are Green then the answer is Green, if there is a mix of Amber and Green then the answer is Amber, if all the cells are Amber then the answer is Amber, if the cells are a mix of Amber and Red then the answer is Red and finally, if all the cells are Red then the answer is Red. I have toyed with different mixes of IF, AND, OR and then XOR but I am struggling to produce the correct answer and wondered if anyone could point me in the right direction please?

Kind Regards
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
This assumes your range is A1:A10 (10 cells), change the range to suit:
Code:
=IF(COUNTIF(A1:A10,"Red")>=1,"Red",IF(COUNTIF(A1:A10,"Amber")>=1,"Amber","Green"))
 
Upvote 0
I think JoeMo's answer will work fine if you're working on cells whose text is the WORDS "Amber", "Green" and "Red", but I wondered if you were trying to filter on text font color. In that case, I think VBA will be required or perhaps manually filtering on the text color, and then using the results of the filter condition to set your "answer" value.
 
Upvote 0

Forum statistics

Threads
1,214,661
Messages
6,120,792
Members
448,994
Latest member
rohitsomani

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