How to show first or last day of previous month based on given date in Excel?
Show first day of previous month based on given dates
Show last day of previous month based on given dates
|To quickly add a specific number of days to a given date, Kutools for Excel's Add Years/Months/Days to Date utilities can give you a favor.|
Recommended Productivity Tools for Excel
Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial
Kutools for Excel: Save 71% of your time and solve 82% Excel problems for you. 300+ advanced tools designed for 1500+ work scenario, make Excel much easy and increase productivity immediately.60-day Unlimited Free Trial
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.
|Kutools for Excel, with more than 120 handy Excel functions, enhance your working efficiency and save your working time.|
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:
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.