Dynamic Month / Year enum

Hi Guys,

Help please. 

I'm trying to find / create a rolling (dynamic) Month / Year expression in the format "MMMM YYYY". I want it to be a drop down of Months and Years (e.g. September 2023) starting TODAY() and looking ahead say 18 months. So right now, for example,  that would give me a list with the first option being this month, July 2023 and ending December 2024 but the list has to "roll" over each month so next month the list will be August 2023 to January 2025.

I'm sure there is someone out there who can help put this together in not time. ๐Ÿ˜€

Many thanks

Richard H

@AleksiAlkio @LeventK 

Solved Solved
0 8 413
1 ACCEPTED SOLUTION

LIST(TEXT(EOMONTH(TODAY(),0),"MMMM YYYY"),TEXT(EOMONTH(TODAY(),1),"MMMM YYYY"),...) should work.

View solution in original post

8 REPLIES 8

I may advise constructing a Settings/Variables page for these kinda things which you can easily create sheet formulas instead of complex expressions that consumes computation time.

In the spreadsheet it's very easy to construct:

=MONTH(TODAY())&" "&YEAR(TODAY())

Provided you also set a variable value i.e. Occurrence - where in your case it's 18 - then you can expand the values in the sheet formula as per this occurrence variable just in case you want to extend it to i.e. 24 in future.

Hope it helps buddy.

Thank you mate! ๐Ÿ‘

LIST(TEXT(EOMONTH(TODAY(),0),"MMMM YYYY"),TEXT(EOMONTH(TODAY(),1),"MMMM YYYY"),...) should work.

And the Almighty has spoken ๐Ÿ™‚

Ha! Ha! ๐Ÿ˜‚๐Ÿ˜‚

Thank you @AleksiAlkio I will try this......but will maybe look at @LeventK's suggestion as well! Wouldn't want to upset anyone!! ๐Ÿ˜‚๐Ÿ˜‚

@RichardHulbert 

Here is the sheet option for your ease of ref:

https://docs.google.com/spreadsheets/d/1myAV3COnR3qGwfvtSL4JiQScekpYVLejZoA-af78g9k/edit?usp=sharing 

You will notice 2 sheet: VARIABLES and DATELIST.

VARIABLES table has 2 columns: VARIABLE and VALUE and has 2 rows: Occurence and Dates respectively. When you change the value of Occurences variable, the Dates will automatically populate and create the sequence.

Enjoy mate ๐Ÿ™‚

Instead of explicitly building the list, is there a way to do a FOR NEXT loop of kind within expressions?  I just started to look for this with indications to use a bot for any loops.

Top Labels in this Space