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

4

13

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

Martyrize answered 29/6, 2015 at 10:23 Comment(0)
I
26

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)
Inane answered 29/6, 2015 at 10:46 Comment(3)
Thanks for your supply, unfortunately it doesn't work. Maybe due to the french version i am using? To me formula must be in english even if i am french but maybe it changed some weeks ago ...Martyrize
OK it works => =date(year(A1), month(A1)-1,1) thank you ZygdMartyrize
And for first day of next (and subsequent months): =date(year(A1),month(A1)+1,1)Jenette
L
5

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

Leclaire answered 31/7, 2018 at 12:13 Comment(0)
I
1

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).

Ibex answered 18/1, 2017 at 15:53 Comment(0)
H
0

Cell A1 To Contain:

=eomonth(A2,-1)+1

Cell A2 To Contain:

=Eomonth(now(),)

if instead of using "now()" you can put in another cells reference, or even do a query/importrange for a particular cell from a different sheet and make these dates even more dynamic.

Hamrnand answered 16/12, 2020 at 16:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.