Note: The other languages of the website are Google-translated. Back to English
English English

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

Kutools for Excel - Helps You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300 powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) and save 80% time for you.

  • Designed for 1500 work scenarios, helps you solve 80% Excel problems.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
  • Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
  • 30-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years.
Ribbon of Excel (with Kutools for Excel installed)

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, Firefox, And New Internet Explorer.
Screen Shot of Excel (with Office Tab installed)
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations