Search code examples
google-sheetsgoogle-sheets-formulaspreadsheet

How to make a automatic sequence of dates (incrementing month) that repeats X times in Google Sheets


Sample

What I need is for the right column (B) to repeat and be automatically filled with those dates (mm/yyyy, from 01/2023 to 12/2023) whenever there is data on the left column (A)

I'm using a formula to increment the months 12 times starting from 01/2023:

=ARRAYFORMULA(EDATE(DATE(2023;0;1);SEQUENCE(12;1;1;1)))

but I can't figure out how to make that range repeatable with the conditional of column A not being empty


Solution

  • Give a try to the following formula-

    =MAP(INDEX(MOD(SEQUENCE(36),12)),LAMBDA(x,IF(x=0,DATE(2023,12,1),DATE(2023,x,1))))
    

    enter image description here