Formula to use with Conditional Formatting based on values in another two cells

Detectiveclem

Active Member
Joined
May 31, 2014
Messages
277
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
Help needed to achieve the following outcome.

I want cell N6 to change background fill colour depending on the following criteria.

  • If Cell K6 is BLANK, I want Cell N6 to have no colour fill.
  • If Cell K6 has a date entered I want Cell N6 fill colour to turn red, UNLESS Cell BG6 has any text in it then I want Cell N6 fill colour to change to green.

I only require help with the correct formula to use, as I am comfortable with other aspects of Conditional Formatting.

Any assistance greatly appreciated.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

etaf

Well-known Member
Joined
Oct 24, 2012
Messages
4,680
Office Version
  1. 365
Platform
  1. MacOS
NOTE , I have used G6 in place of BG6 - just to simplify the display here in XL2BB and not make it large with a lot of empty space

create 2 rules
select N6

green fill
=And( k6<>"", bg6<>"")

new rule for red fill
=And( k6<>"", bg6="")

for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>

N6



Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:


=And( k6<>"", bg6<>"")


Format [Number, Font, Border, Fill] - choose GREEN
choose the format you would like to apply when the condition is true
OK >> OK
REPEAT for RED Fill rule
=And( k6<>"", bg6="")

Book6
FGHIJKLMNO
4
5BG6K6N6
611
7
8
9
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
N6Expression=AND(K6<>"",G6<>"")textNO
N6Expression=AND(K6<>"",G6="")textNO


 
Last edited:
Solution

Detectiveclem

Active Member
Joined
May 31, 2014
Messages
277
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
NOTE , I have used G6 in place of BG6 - just to simplify the display here in XL2BB and not make it large with a lot of empty space

create 2 rules
select N6

green fill
=And( k6<>"", bg6<>"")

new rule for red fill
=And( k6<>"", bg6="")

for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>

N6



Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:


=And( k6<>"", bg6<>"")


Format [Number, Font, Border, Fill] - choose GREEN
choose the format you would like to apply when the condition is true
OK >> OK
REPEAT for RED Fill rule
=And( k6<>"", bg6="")

Book6
FGHIJKLMNO
4
5BG6K6N6
611
7
8
9
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
N6Expression=AND(K6<>"",G6<>"")textNO
N6Expression=AND(K6<>"",G6="")textNO


Thank you so much ETAF, I been trying so many options but just couldn't get it to work. Thank it works perfectly now.
 

etaf

Well-known Member
Joined
Oct 24, 2012
Messages
4,680
Office Version
  1. 365
Platform
  1. MacOS
you are welcome, glad to have helped
 

Watch MrExcel Video

Forum statistics

Threads
1,130,119
Messages
5,640,219
Members
417,131
Latest member
Seanr19871

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