Conditional Formatting (highlighting a column)

muhleebbin

Active Member
Joined
Sep 30, 2017
Messages
252
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2010
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
I have data in cells B8:AA17 where data is in rows 8:16 and a sum function in row 17. I'm trying to have a conditional format where if row 7 (month) is less or equal to the actual month and if row 17 is 0 that it highlights the column between rows 8:17.

I'm using this formula =IF(AND(B7<=$AC$1,B17=0),TRUE,FALSE) for the conditional format rule for area B8:AA17 but it only highlights row 8. Can someone please help me fix my stupidity?

Thanks in advance!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
If you want all the cells to look at rows 7 and 17, you need to lock the row numbers down in your formula by placing a "$" in front of them, i.e.
=AND(B$7<=$AC$1,B$17=0)

Also, there is no need to use an IF formula. The AND function already returns a boolean value (True/False), so you don't need to tell it to do so explicitly.
So writing it like I have shown above should be sufficient.
 
Upvote 0
Solution
If you want all the cells to look at rows 7 and 17, you need to lock the row numbers down in your formula by placing a "$" in front of them, i.e.
=AND(B$7<=$AC$1,B$17=0)

Also, there is no need to use an IF formula. The AND function already returns a boolean value (True/False), so you don't need to tell it to do so explicitly.
So writing it like I have shown above should be sufficient.
Thank you for saving me from myself! :ROFLMAO: Totally worked!
 
Upvote 0
You are welcome.
 
Upvote 0

Forum statistics

Threads
1,214,847
Messages
6,121,911
Members
449,054
Latest member
luca142

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