Excel Formula: Get First or Last Day of Previous Month
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.
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.
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.
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.
Explanation
EOMONTH function: gets the last day of month n months in future or past.
Relative Formulas
- Count months between two dates with formula
In this tutorial, it provides formulas to count months between two given dates. - Count days until expiration date
To count the days between today and each expiration date in Excel by formula - Display current date or time
This tutorial provides formulas to show the current date or time in Excel. - Create weekly date range
In this tutorial, it provides a formula to quickly get the weekly date range in Excel.
Relative Functions
- Excel WEEKNUM Function
Returns the week number of the given date in a year - Excel EMONTH Function
Gets the last day of month n months in future or past. - Excel MONTH Function
The MONTH is used to get the month as integer number (1 to 12) from date - Excel DAY Function
DAY function gets the day as a number (1 to 31) from a date - Excel NOW Function
Get the current time and date
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...
Supports Office/Excel 2007-2021 and 365 | Available in 44 Languages | Easy to Uninstall Completely

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.
