Conditional Format

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
597
Office Version
  1. 365
I know this should be simple, but my head won't work this out!
In Row 1 I have months
In Column A I have dates of work started
What I need is conditional format to "grey out" the cell if the date in column A is before the start date of the month

So if the date was 02/04/19 it will leave the April column blank,
if it was 2 May 2019, it would grey out April, but leave May 2019 blank,
if it was June, then both April and May would be greyed out etc.

[table="width: 500, class: Grid, align: Center"]
[tr]
[td][/td]
[td]a[/td]
[td]b[/td]
[td]c[/td]
[td]d[/td]
[td]e[/td]
[/tr]
[tr]
[td]1[/td]
[td][/td]
[td]APRIL 2019[/td]
[td]MAY 2019[/td]
[td]JUNE 2019[/td]
[td]JULY 2019[/td]
[/tr]
[tr]
[td]2[/td]
[td]03/04/19[/td]
[td][/td]
[td][/td]
[td][/td]
[td][/td]
[/tr]
[tr]
[td]3[/td]
[td]07/05/19[/td]
[td](GREYED OUT)[/td]
[td][/td]
[td][/td]
[td][/td]
[/tr]
[tr]
[td]4[/td]
[td]06/06/19[/td]
[td](GREYED OUT)[/td]
[td](GREYED OUT)[/td]
[td][/td]
[td][/td]
[/tr]
[tr]
[td]5[/td]
[td]01/08/19[/td]
[td](GREYED OUT)[/td]
[td](GREYED OUT)[/td]
[td](GREYED OUT)[/td]
[td](GREYED OUT)[/td]
[/tr]
[/table]
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
What are the actual values in B1,C1 etc?
 
Upvote 0
A custom rule would work, highlight the region you want to apply to then open a new CF rule and put:

=AND(MONTH($A2)>MONTH(B$1),YEAR($A2)>=YEAR(B$1)) --> Format with however you choose (greyed pattern style would be ideal under fill tab on format cells)

EDIT: Taken into account of the year too incase month piles over to following year.
 
Last edited:
Upvote 0
Apologies, that doesn't quite work as intended after some further testing...

Try:
=AND($A2>B$1,OR(MONTH($A2)>MONTH(B$1),YEAR($A2)>YEAR(B$1)))
 
Upvote 0
Select B2 to the end of data & use
=$A2>EOMONTH(B$1,0)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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