# Create a Dynamic Calendar with function SEQUENCE and some formatting

#### DRSteele

##### Well-known Member
DRSteele submitted a new Excel article:

Create a Dynamic Calendar with function SEQUENCE and some formatting - Using Excel's new dynamic array formulas, we can easily generate a calendar based on a date

Let’s create a dynamic calendar in Excel the quick and easy way. We can use the clever new Excel function SEQUENCE in Excel 365 Insider. Mr. Excel (Bill Jelen) sparked this idea with this video and I enhanced the concept so that all we need is a date to make the calendar matarialise in the spilled cells, automatically formatted with Conditional Formatting.

Format a block of 42 cells (7Cx6R), here B5 to H10, using Conditional...

### Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

#### MrExcel

##### .
Nice enhancements! Thanks for writing this up DRSteele!

#### DRSteele

##### Well-known Member
Thanks for saying so, Bill. You're welcome.

Don.

#### Peter_SSs

##### MrExcel MVP, Moderator
Using that as a starting point, I think we can use a considerably simpler sequence formula?

Format a block of 42 cells (7Cx6R), here B5 to H10, using Conditional Formatting (Outline border and black font) with the CF formula as shown below. Format B5 to H10 as custom number format as d and with white font. A4 whatever date format you want.

Peter_SSs Calendar Test.xlsm
ABCDEFGHI
2
3SunMonTueWedThuFriSat
430/08/2020August
52627282930311
62345678
79101112131415
816171819202122
923242526272829
10303112345
11
PS
Cell Formulas
RangeFormula
B4B4=TEXT(A4,"mmmm")
B5:H10B5=SEQUENCE(6,7,EOMONTH(A4,-1)+2-WEEKDAY(EOMONTH(A4,-1)+1),1)
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B5:H10Expression=TEXT(B5,"mmmm")=\$B\$4textNO

Last edited:

#### smozgur

##### BatCoder
I really started enjoying Dynamic Array Formulas even I found how it works a bit strange at the beginning. Thanks for the article @DRSteele and thanks for the improvement @Peter_SSs! This is a great power in Excel!

#### DRSteele

##### Well-known Member
Smozgur, I'm glad you like the Calendar! It's great fun, these new functions and their dynamism. Very powerful. You'll rapidly get used to how the spilling technology works. And you'll rapidly get annoyed that the formatting does not spill along with the formulas.

And thanks Peter for the super improvement!

#### Peter_SSs

##### MrExcel MVP, Moderator
And thanks Peter for the super improvement!

For those that like shorter formulas (though no fewer functions here)
=SEQUENCE(6,7,EOMONTH(A4,-1)+2-WEEKDAY(EOMONTH(A4,-1)+1),1)
could be replaced by
=SEQUENCE(6,7,A4-DAY(A4)+2-WEEKDAY(A4-DAY(A4)+1))

#### rjplante

##### Active Member
I have created your dynamic calendar in an excel spreadsheet and it is pretty cool. I have added formatting to the Month in cell B5 so that it is formatted as mmmm - yyyy. I was wondering if there is a way to use conditional formatting to highlight the day on the calendar that matches the day in the date entered into A4. For example if 2/25/2020 is added to A4, the cell with 25 in it would be highlighted and the cell would be filled with a color of your choosing or outlined in a thick red border. Is it possible to do this?

#### DRSteele

##### Well-known Member
Sure RJ, we can do that.

Highlight cells B5 to H10. Create a new CF rule that has the cell value =\$A\$4 and then select your formatting. That way, the Calendar will have the current day formatted.

#### KevCarter

##### Board Regular
Thank you DrSteele and Peter. Very cool formulas!!!