I need to dynamically create an array containing all months between two dates, using =DATEDIF()
in Google Spreadsheets. For instance, =DATEDIF(B2,B3,"M")
returns 11
, so I need an array containing all the months between October 2015 and September 2016.
Is it possible to accomplish this using formulas? Many thanks!
try this:
=ArrayFormula(TEXT(EOMONTH(A1,row(OFFSET(A1,,,DATEDIF(A1,A2,"m")))-1),"m"))
assuming A1 = date1 (October 2015), A2 = Date2 (September 2016) in date format. A1
in offset part is the refference on first cell.
change second "m" in formula to get formats: