How to generate sequences in Google Sheets

Viewed 34

I'l like to create a sequence of dates using "sequence formula" with a start and end date. I mean, something like this:

start date = 2020-01-01
end date = 2022-12-01

I just also want to bring the first day of the month, like the following example:

2020-01-01
2020-02-01
2020-03-01
......
2022-10-01
2022-11-01
2022-12-01

How can I get this? Is there another way to do it?

Thanks!!!

2 Answers

There are several ways to approach this. Here is one I recommend:

=ArrayFormula(DATE(2020,SEQUENCE(DATEDIF("2020-01-01", "2022-12-01", "m")+1),1))

You'll replace the first 2020 with the year of your starting date and the next two string-dates with your full start and end date. That's it.

Just make sure you leave enough cells open below this formula to accommodate the number of dates you're requiring the formula to output.

Format the output range in the date format you prefer (Format > Number...).

Simple SEQUENCE() should work. Try-

=SEQUENCE((B1-A1)+1,1,A1)

enter image description here

Related