DRSteele

Create a Dynamic Calendar with function SEQUENCE and some formatting

DRSteele

Well-known Member
Joined
Mar 31, 2015
Messages
2,088
Office Version
365
Platform
Windows
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...
Read more about this Excel article...
 
Joined
Feb 8, 2002
Messages
890
Office Version
365
Platform
Windows
Nice enhancements! Thanks for writing this up DRSteele!
 

DRSteele

Well-known Member
Joined
Mar 31, 2015
Messages
2,088
Office Version
365
Platform
Windows
Thanks for saying so, Bill. You're welcome.

Don.
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
42,706
Office Version
365
Platform
Windows
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
Joined
Feb 28, 2002
Messages
888
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
Joined
Mar 31, 2015
Messages
2,088
Office Version
365
Platform
Windows
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
Joined
May 28, 2005
Messages
42,706
Office Version
365
Platform
Windows
And thanks Peter for the super improvement!
(y)


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))
 

Forum statistics

Threads
1,085,749
Messages
5,385,663
Members
401,967
Latest member
Sullivag2

Some videos you may like

This Week's Hot Topics

Top