Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The last & the first day of a month in Google Sheets

How to get the first and last day of the previous month in Google Sheets?

like image 863
mike1789 Avatar asked Jun 29 '15 10:06

mike1789


3 Answers

If you had your base date in A1,
this will return the date of the last day of the previous month:

=eomonth(A1,-1)

For the date of the first day of the previous month, this is the shortest way:

=eomonth(A1,-2)+1

Also possible:

=date(year(A1),month(A1)-1,1)
like image 147
ZygD Avatar answered Oct 31 '22 09:10

ZygD


for the last day of the previous month (international)

=eomonth(now();-1)

for the last day of the previous month (USA)

 =eomonth(now(),-1)

for the first day of the previous month (international)

=eomonth(now();-2)+1

for the first day of the previous month (USA)

    =eomonth(now(),-2)+1

Demo:

enter image description here

like image 25
Richard de Ree Avatar answered Oct 31 '22 10:10

Richard de Ree


Use =eomonth((eomonth(today(),0)),-2)+1 for use when you want previous from today.

For the last day of the previous month, use =eomonth((eomonth(today(),0)),-1).

like image 1
elyhim Avatar answered Oct 31 '22 09:10

elyhim