DRSteele

Create a Dynamic Calendar with function SEQUENCE and some formatting

DRSteele

Well-known Member
Joined
Mar 31, 2015
Messages
2,255
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...
 

Some videos you may like

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Joined
Feb 8, 2002
Messages
893
Office Version
365
Platform
Windows
Nice enhancements! Thanks for writing this up DRSteele!
 

DRSteele

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

Don.
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
45,193
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
953
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,255
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
45,193
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))
 

rjplante

Active Member
Joined
Oct 31, 2008
Messages
475
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
Joined
Mar 31, 2015
Messages
2,255
Office Version
365
Platform
Windows
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.

Annotation 2020-02-25 153112.jpg
 

KevCarter

Board Regular
Joined
Dec 7, 2013
Messages
74
Office Version
365
Platform
Windows, MacOS
Thank you DrSteele and Peter. Very cool formulas!!!
 

Watch MrExcel Video

Forum statistics

Threads
1,102,360
Messages
5,486,388
Members
407,544
Latest member
mguevara

This Week's Hot Topics

Top