Conditional format dates based on year/quarter

Beau the dog

Board Regular
Joined
Mar 8, 2021
Messages
52
Office Version
  1. 365
Platform
  1. Windows
So, I have a list of data (obviously!). I want to highlight the rows based on which year and which quarter I select. I realise this is purely for aesthetics, but I'm a little OCD with that! The word "Quarter" is in Cell A1. So I've selected 4th quarter and year 2021 in cells B1 and C1 respectively, so row 3,4 and 5 should be highlighted, I'd like to colour entire rows please.


Quarter42021
MonthPassFailPass %
Oct-2140100%
Nov-217370%
Dec-2150100%
Jan-2220100%
Feb-2220100%
Mar-224180%
Apr-2260100%
May-2230100%
Jun-222250%
Jul-221100%
Aug-2250100%
Sep-2220100%
Oct-2240100%
Nov-2260100%
Dec-224180%
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
77,755
Office Version
  1. 365
Platform
  1. Windows
How about
+Fluff 1.xlsm
ABCD
1Quarter22022
2MonthPassFailPass %
3Oct-2140100%
4Nov-217370%
5Dec-2150100%
6Jan-2220100%
7Feb-2220100%
8Mar-224180%
9Apr-2260100%
10May-2230100%
11Jun-222250%
12Jul-221100%
13Aug-2250100%
14Sep-2220100%
15Oct-2240100%
16Nov-2260100%
17Dec-224180%
18
19
Lists
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:D100Expression=AND(YEAR($A3)=$C$1,MEDIAN(MONTH($A3),$B$1*3,$B$1*3-2)=MONTH($A3))textNO
 

etaf

Well-known Member
Joined
Oct 24, 2012
Messages
6,167
Office Version
  1. 365
Platform
  1. MacOS
how about
=AND(ROUNDUP(MONTH($A3)/3,0)=$B$1, YEAR($A3)=$C$1)

Book1
ABCD
1Quarter42021
2MonthPassFailPass %
3Oct-2140100%
4Nov-217370%
5Dec-2150100%
6Jan-2220100%
7Feb-2220100%
8Mar-224180%
9Apr-2260100%
10May-2230100%
11Jun-222250%
12Jul-221100%
13Aug-2250100%
14Sep-2220100%
15Oct-2240100%
16Nov-2260100%
17Dec-224180%
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:D17Expression=AND(ROUNDUP(MONTH($A3)/3,0)=$B$1, YEAR($A3)=$C$1)textNO
 
Solution

Beau the dog

Board Regular
Joined
Mar 8, 2021
Messages
52
Office Version
  1. 365
Platform
  1. Windows
Both of these solutions work perfectly, thank you both :)

I flipped a coin as who to mark as solution!!
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
77,755
Office Version
  1. 365
Platform
  1. Windows
Glad we could help & thanks for the feedback.
 

etaf

Well-known Member
Joined
Oct 24, 2012
Messages
6,167
Office Version
  1. 365
Platform
  1. MacOS
you are welcome
 

Forum statistics

Threads
1,176,237
Messages
5,902,073
Members
434,938
Latest member
distalnyovac07

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