Real date as the first day of the month

At Google Sheets, I am looking for an array formula to provide the first day of the month for a given date. For example, if A1 is 1/17/12 20:30 B1 will read 1/1/12 and so on. The formula must keep the date format so that I can sort by date in column B in this example.

+4
source share
2 answers

I think you could just β€œmake up” a new date using the DATE formula. eg.

 =Date(Year(A1);Month(A1);1) 
+5
source

Let me add to the contribution of Enrique ...

I can use the following formula in cell B1:

 =ArrayFormula(if(A:A,eomonth(A:A,-1)+1,)) 

where column A contains dates or timestamps

+1
source

Source: https://habr.com/ru/post/1391743/


All Articles