Skip to main content

Excel Formula: Get First or Last Day of Previous Month

doc convert date to julia 1

In this tutorial, it provides formulas to get the first or last day of previous month in Excel.

If you want to follow along with this tutorial, please download the example spreadsheet.
doc convert date to julia 1

Get first day of previous month

 

Generic formula:

EOMONTH(date,-2)+1

Syntaxt and Arguments

Date: the date that you want to get the first day of its previous month.

Return Value

It returns a value in date format.

Error Value

If the date is not a valid date (a date before 1/1/1900 or is a text value), the formula returns the error value #VALUE!.

How this formula works

To get the first day of previous month of the date in cell B3, please use below formula:

=EOMONTH(B3,-2)+1

Press Enter key to get the result.
doc convert date to julia 1

Explanation

EOMONTH function: gets the last day of month n months in future or past.

The formula EOMONTH(B3,-2) returns the last day of previous 2 months. Then plus 1 to get the first day of previous 1 month.

Get last day of previous month

 

Generic Formula

EOMONTH(date,-1)

Syntax and Arguments

Date: the date that you want to get the last day of its previous month based on.

Return Value

It returns a numeric value. For reading date more visually, you can format the result as date format.

Error Value

If the argument date is not a valid date (a date before 1/1/1900 or is a text value), the formula returns the error value #VALUE!.

How the formula works

To get the last day of previous month of the date in cell B3, please use below formula:

=EOMONTH(B3,-1)

Press Enter key to get the result.
doc convert date to julia 1

Then under Home tab, in the Number group, click the drop-down list of Number Format to choose Short Date or Long Date as you need.
doc convert date to julia 1

Explanation

EOMONTH function: gets the last day of month n months in future or past.


Relative Formulas

Relative Functions


The Best Office Productivity Tools


Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations