A formula with a lot of conditions..

missmyady

New Member
Joined
Jan 17, 2014
Messages
2
Hi, I need a field (DepField) that depends on seven other fields (Let's say the fields are named 1-7). All fields (including the dependent field can be either "Red", "Yellow" or "Green"

There are different conditions for the dependent field (DepField):

If either field: 1, 3 or 4 = "Red", then DepField = "Red"

if two or more of fields 1-7 = "Red", then DepField = "Red"

If either field: 1, 3 or 4 = "Yellow", then DepField = "Yellow"

if two or more of fields 1-7 = "Yellow", then DepField = "Yellow"

Else DepField = "Green"

Thank you for taking your time.

Best Regards missmyady
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

anglais428

Well-known Member
Joined
Nov 23, 2009
Messages
634
Office Version
  1. 2016
Platform
  1. Windows
I have put your range of 'fields 1 to 7' in Range B1:B7, with the below formula in cell B8:
=IF(OR(B1="Red",B3="Red",B4="Red"),"Red",IF(COUNTIF($B$1:$B$7,"Red")>1,"Red",IF(OR(B1="Yellow",B3="Yellow",B4="Yellow"),"Yellow",IF(COUNTIF($B$1:$B$7,"Yellow")>1,"Yellow","Green"))))
 

Forum statistics

Threads
1,136,854
Messages
5,678,141
Members
419,746
Latest member
tysonboy82

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
Top