Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Get Month: How to Extract Months from Dates

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To get the month from a date in Excel, use the MONTH function: =MONTH(serial_number). This formula returns a number from 1 (January) to 12 (December) based on the date provided in the referenced cell. If you need the month as a name (e.g., "January") instead of a number, use the TEXT function: =TEXT(A1, "mmmm").

What You'll Need

  • A computer with Microsoft Excel installed (works on Office 365, Excel 2021, 2019, 2016, and older versions).
  • A dataset containing dates formatted as recognized Excel date values.
  • Basic knowledge of how to enter a formula into a cell.

Step-by-Step

  1. Prepare Your Data: Ensure your dates are in a single column. For example, place your dates in column A, starting from cell A2. Verify that Excel recognizes these as dates; by default, dates are right-aligned in a cell. If they are left-aligned, Excel may be treating them as text, which will cause the MONTH function to return a #VALUE! error.
  2. Select the Destination Cell: Click on the cell where you want the month result to appear. If your date is in A2, click on cell B2.
  3. Enter the MONTH Formula: Type =MONTH(A2) into the formula bar or directly into the cell. Press Enter. Excel will now display the numerical value of the month. For instance, if A2 contains "2023-05-15", the result in B2 will be 5.
  4. Apply to All Rows: To extract the month for the rest of your list, hover your mouse over the bottom-right corner of cell B2 until the cursor turns into a small black cross (the Fill Handle). Click and drag the handle down to the end of your data range.
  5. Convert Numbers to Month Names (Optional): If you prefer the word "May" instead of the number 5, go back to cell B2 and enter the formula =TEXT(A2, "mmmm"). The "mmmm" code tells Excel to return the full name of the month. If you only want the three-letter abbreviation (e.g., "May" or "Jan"), use =TEXT(A2, "mmm").
  6. Lock the Results (Optional): Because these are formulas, the month will change if the date in column A changes. To make the months permanent text, select the results in column B, copy them (Ctrl + C), right-click the same area, and select Paste Special > Values. This removes the formula and keeps only the result.

Common Mistakes

One of the most frequent errors is applying the MONTH function to a cell that looks like a date but is actually stored as text. Excel stores dates as sequential serial numbers; for example, January 1, 1900, is serial number 1. If you typed a date in a format Excel doesn't recognize (like 15.05.2023 in a US-region setup), the MONTH function cannot perform the math and will fail. Always check that your dates are correctly formatted using the Number Format dropdown in the Home tab.

Another common mistake is confusing the MONTH function with cell formatting. Some users change the cell format to "Month" using the Format Cells menu. While this makes the cell display the month name, the underlying value remains the full date. If you try to use that cell in a Pivot Table or a SUMIFS formula, Excel still sees the day and year, which can lead to incorrect grouping or calculation errors. To actually extract the month for data analysis, you must use a formula.

Users also often forget that the MONTH function only returns a number. If you need to sort your data chronologically by month name, simply sorting alphabetically (April, August, December...) will not work. You must either keep the numerical month column for sorting or use a custom sort list in Excel.

Tips

To create a dynamic dashboard, combine the MONTH function with the IF function or a LOOKUP table. For example, if you want to categorize months into quarters, you can use a formula like =IF(MONTH(A2)<=3, "Q1", IF(MONTH(A2)<=6, "Q2", IF(MONTH(A2)<=9, "Q3", "Q4"))). This allows you to transform a simple date into a high-level reporting category.

If you are working with a massive dataset, consider using a Pivot Table instead of individual formulas. When you add a date field to the "Rows" area of a Pivot Table, Excel often automatically groups the dates by Year, Quarter, and Month. You can right-click any date in the Pivot Table and select Group > Months to achieve the same result as the MONTH function without writing a single formula.

For those who need the month name in a different language, the TEXT function can be modified with a locale code. While standard Excel uses your system settings, advanced users can use specific codes within the TEXT function to force a specific language's month names, though this is typically handled by changing the system's regional settings in the Control Panel.

Troubleshooting

The result is a weird date (e.g., January 1900) instead of a number: This happens because Excel automatically formatted your result cell as a "Date" because the source cell was a date. To fix this, select the cell with the result, go to the Home tab, and change the Number Format dropdown from "Date" to "General" or "Number". The weird date will turn back into a simple number (1-12).

The formula returns #VALUE!: This is a clear sign that Excel does not recognize the content of the source cell as a valid date. Check for leading spaces, hidden characters, or non-standard delimiters (like using dots instead of slashes). You can try to fix this by selecting the date column, going to the Data tab, clicking "Text to Columns", clicking "Next" twice, and in the third step, selecting "Date" and the correct format (e.g., MDY) before clicking Finish.

The formula returns #NAME?: This usually means there is a typo in the function name. Ensure you have typed =MONTH( and not =MONTHS( or =MONTHS(. Excel functions must be spelled exactly as defined.

The month is incorrect (e.g., it says 1 when it should be 2): Double-check the date in the source cell. If you are using a date from a different region (e.g., DD/MM/YYYY vs MM/DD/YYYY), Excel might be swapping the day and month. For example, 01/02/2023 could be interpreted as January 2nd or February 1st depending on your region. Check your system's regional date settings to ensure consistency.

Frequently Asked Questions

Can I get the month name without using a formula?

Yes, you can change the cell's appearance using Custom Formatting. Right-click the cell, select Format Cells, go to the Number tab, select Custom, and type "mmmm" in the Type box. This changes the display, but the cell still contains the full date value.

How do I get the month as a two-digit number (e.g., 05 instead of 5)?

The MONTH function only returns a single digit for months 1-9. To get a leading zero, use the TEXT function: =TEXT(A2, "mm"). This converts the number to text and ensures it always has two digits.

Does the MONTH function work with dates stored as text?

Generally, no. If the date is stored as text, the MONTH function will return a #VALUE! error. You must first convert the text to a date using the DATEVALUE function or the Text-to-Columns tool.

How do I find the month of the current date automatically?

You can nest the TODAY function inside the MONTH function. Use the formula =MONTH(TODAY()). This will always return the number of the current month based on your computer's system clock.

Can I extract the month from a date that includes a time stamp?

Yes. Excel stores dates and times as a single number (the date is the integer and the time is the decimal). The MONTH function ignores the decimal part and only looks at the integer, so it works perfectly with date-time stamps.