Format Date for last month and year (1 Viewer)

nirmal

Member
Local time
Today, 16:14
Joined
Feb 27, 2020
Messages
82
I am trying to get the last month and year by
=Format(Date(),"mmmm" & " " & "yyyy")
Here I am getting March 2023
Actually I am trying to get the sequential last mont with year like February 2023
Tried all, but in vain
Please guide
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:44
Joined
May 7, 2009
Messages
19,245
=Format(DateAdd("m",-1,Date()),"mmmm" & " " & "yyyy")
 

nirmal

Member
Local time
Today, 16:14
Joined
Feb 27, 2020
Messages
82
Thank you Sir
It worked as expected.
Thank Again
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:44
Joined
May 7, 2009
Messages
19,245
the format can be simplified:

=Format(DateAdd("m",-1,Date()),"mmmm yyyy")
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:44
Joined
Sep 21, 2011
Messages
14,311
I am trying to get the last month and year by
=Format(Date(),"mmmm" & " " & "yyyy")
Here I am getting March 2023
Actually I am trying to get the sequential last mont with year like February 2023
Tried all, but in vain
Please guide
Why would you think that Date() would give you the previous month? :unsure:
 

Users who are viewing this thread

Top Bottom