How to show first or last day of previous month based on given date in Excel?
![doc previous month last day first day 1](http://cdn.extendoffice.com/images/stories/doc-excel/previous-month/doc-previous-month-last-day-first-day-1.png)
Show first day of previous month based on given dates
Show last day of previous month based on given dates
Show first day of previous month based on given dates
To show the first day of previous month, here is a formula can quickly solve.
Select a blank cell next to the given date, for instance, B2, and enter this formula =EOMONTH(A2,-2)+1, A2 is the given date, and then drag auto fill handle over the cells which you need to apply this formula. See screenshot:
Now the first day of previous month based on each given dates has been displayed.
Show last day of previous month based on given dates
To find the last day of previous month by given dates, you can apply one of below formulas to a blank cell and then apply the formula to the cells you want by dragging the auto fill handle. See screenshot:
=EOMONTH(A2,-1)
=DATE(YEAR(A2),MONTH(A2),0)
Note: the formula =EOMONTH(A2,-1) will return 5-digits number. For changing the 5-digits number to standard date, please select it and click Home > Number Format > Short Date.
Relative Article:
How to easily enter dates without slashes in Excel?
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!