Being able to apply functions and formats to dates is an excellent feature of Excel, and it can make date-related tasks extremely easy. This tutorial will teach us how to get the previous month’s name from a date in Excel.
First, we will learn how to get the previous month’s name, and then the current month’s name.
1) Get the Previous Month’s Name
We will first learn how to get the previous month’s name. From there, we will continue to get the current month’s name from any date, or today’s date.
Method 1: Using the TEXT Function
We will simply subtract the number of days in our date from the date itself, which will take us to the last day of the previous month. From there, we will get the previous month’s name with the TEXT function.
First, we have today’s date:
=TODAY()
We subtract the number of days within today’s date, from today:
=TODAY() – DAY(TODAY())
This gives us the last day of the previous month (cell B3 below). Now, we will obtain the month from this date using the TEXT function:
=TEXT(TODAY() - DAY(TODAY()), "mmmm")

So, the formula to get the previous month’s name is:
=TEXT(TODAY() - DAY(TODAY()), "mmmm")
You can apply this formula to any cell that contains a date, by replacing the TODAY function with the cell name:
=TEXT(A1 - DAY(A1), "mmmm")

Method 2: Using the EOMONTH Function
Instead of subtracting days from TODAY(), you can leverage Excel’s built‑in EOMONTH to jump directly to the last day of the previous month, then extract its name:
=TEXT(EOMONTH(A1, -1),"mmmm")
- How it works
EOMONTH(A1, -1)returns the serial date for the last day of the month that’s one month before the date in A1.- Wrapping that in
TEXT(…, "mmmm")formats it as the full month name (e.g. “July”).
- Why use it?
- Cleaner logic: no need to calculate
DAY(...)separately. - Handles month‑end quirks automatically (e.g. leap years, 30‑ vs. 31‑day months).
- Readable for anyone familiar with the common EOMONTH pattern.
- Cleaner logic: no need to calculate
Method 3: Custom VBA – PrevMonthName()
To add the PrevMonthName function yourself:
Paste in this code:
Open the workbook in Excel and press Alt + F11 to launch the VBA editor.
In the Project panel, right-click your workbook ➔ Insert ➔ Module.
Paste in this code:
Function PrevMonthName(dt As Date) As String
PrevMonthName = Format(DateSerial(Year(dt), Month(dt) - 1, 1), "mmmm")
End Function
Save As ➔ choose Excel Macro-Enabled Workbook
Now, you can use this function:
=PrevMonthName(A1)
- Pros:
- Simplifies formulas on the sheet to a single, self‑documenting call.
- Easily extended (e.g. make it return abbreviated names, locales, etc.).
Simple, right? Once you get used to the formulas in Excel, everything is possible. In this tutorial, we learned how to get the current month and the previous month from any date. Nice job!
2) Get the Current Month’s Name
We will first learn how to get the current month’s name from any date, or today’s date. From there, we will continue to get the previous month’s name.
As you know, there are different formats of cells, such as number, currency, date, time, text, etc. You can check the format of a cell by right-clicking on the cell, and then clicking Format Cells.
If you want to get the current month from a date within a cell, you first need to make sure that the cell is in the date format.
Using the TEXT Function
Step 1: Right-click the cell that contains a date, and click on “Format Cells…”.

Step 2: Select Date under Category, and then click on OK.

If you entered the date in the correct format such as 02/14/2023, the format of the cell can also automatically be determined by Excel as Date.
Step 3: In a new cell, write the following formula:
=TEXT(A1, "mmmm")

In place of A1, you can write any cell name or today’s date with the TODAY function:
=TEXT(TODAY(), "mmmm")

The TEXT function takes the date as an argument and returns the month name, whose format is determined with the “mmmm” argument.
Using Format Cells
The same operation can be performed with the Format Cells dialog box.
Step 1: Right-click on the cell that contains the date, and click on Format Cells.
Step 2: Select Custom under Category. Type “mmmm” in the Type text box, then click on OK.

This will convert the current date into the current month:
