Conditional formatting for "not february"

mistah_q

New Member
Joined
Nov 21, 2019
Messages
13
Office Version
  1. 2019
I am constructing a workbook with 12 worksheets, one for each month of the year, and I can't seem to crack this:

Conditional formatting - highlight entire row if month is not X. The reason - so it's highlighted if an entry is put on the wrong month's tab.

=MONTH($H1)<>1

Works just fine on the January worksheet. But

=MONTH($H1)<>2

2, or 3, or any other month... it doesn't work on the other tabs. Instead it turns my entire sheet yellow.

I believe what's happening is that Excel counts any old blank cell as "January 0" so trying to use a "if cell is not february" (or march etc) will just light up my entire worksheet like a christmas tree.

Is there some way around this?
 

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
How about =ISNUMBER($H1) * (MONTH($H1)<>1)

I'd be reluctant to apply CF to an entire sheet.
 
Last edited:
Upvote 0
Missing a pair of parens in that, corrected above.
 
Upvote 0
Hmm, with your correction added, this works. Thank you.

I discovered another solution - an additional rule of:

=$H1=DATE(1900,1,0) with no formatting that must be above the =MONTH($H1)<>2 rule but below other rules... your solution works more elegantly.
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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