Skip to main content
ExcelMONTHDate & TimeDate ExtractionData Analysis

The Problem

Are you staring at a spreadsheet filled with dates, needing to quickly segment your data by month? Perhaps you're managing project timelines, analyzing sales figures, or tracking expenses, and the month component is crucial for your reporting. Manually sifting through thousands of dates to identify which month they fall into can feel like trying to find a needle in a haystack – tedious, error-prone, and a massive time drain.

What is MONTH? MONTH is an Excel function that extracts the month number (1-12) from a given date. It is commonly used to categorize data by month, filter records, or perform month-based calculations without needing to manually parse text. Without a specialized tool like the MONTH function, you might find yourself stuck, unable to easily group your data for monthly summaries or trend analysis. This specific, realistic workplace scenario often leaves professionals searching for an efficient solution to unlock their date-driven insights.

The Ingredients: Understanding MONTH's Setup

To begin our recipe, let's understand the core "ingredient" of the MONTH function. It's elegantly simple, requiring just one piece of information: the date you want to analyze. According to Microsoft documentation, the MONTH function works by taking a single argument.

Here's the syntax you'll use:

MONTH(serial_number)

Let's break down this essential parameter:

Parameter Description
serial_number This is the date from which you want to extract the month. In Excel, dates are stored as serial numbers, with January 1, 1900, being serial number 1. You can provide this argument as:
  • A cell reference containing a date (e.g., A2)
  • A date entered directly as a text string (e.g., "2023-01-15") – though this is less common for dynamic use.
  • The result of another function that returns a date (e.g., TODAY() or DATE(2023,1,15)).
The serial_number must represent a valid date for the MONTH function to work correctly.

The serial_number is your key to unlocking the month. It's the numerical representation that Excel uses to understand time, and the MONTH function expertly deciphers it to give you exactly what you need.

The Recipe: Step-by-Step Instructions

Let's walk through a practical scenario. Imagine you're managing sales data and need to categorize each transaction by its month to analyze monthly performance. The MONTH function is perfect for this task.

Here’s our sample sales data:

Transaction ID Date Sales Amount Monthly Segment
T-001 2023-01-15 $120.50
T-002 2023-02-28 $210.00
T-003 2023-01-05 $75.25
T-004 2023-03-10 $150.75
T-005 2023-02-01 $99.99
T-006 2023-04-20 $300.00

Our goal is to populate the "Monthly Segment" column (Column D) with the corresponding month number for each transaction date.

Here’s how to do it, step-by-step:

  1. Prepare Your Data: Ensure your dates are in a column, as shown above. For our example, the dates are in column B, starting from B2.

  2. Select Your Output Cell: Click on cell D2, where you want the first month number to appear. This is where we’ll enter our MONTH function formula.

  3. Enter the MONTH Function: In cell D2, begin typing the formula: =MONTH(. Excel will prompt you with the function's syntax, guiding you along the way.

  4. Reference the Date: Now, you need to tell the MONTH function which date to analyze. Click on cell B2, which contains the date "2023-01-15". Your formula should now look like: =MONTH(B2.

  5. Complete the Formula: Close the parentheses ) to finish the MONTH function. The complete formula in cell D2 should be: =MONTH(B2).

  6. Press Enter: Hit the Enter key. Cell D2 will now display 1, correctly representing January.

  7. AutoFill for the Remaining Data: To apply this formula to the rest of your dates, click on cell D2 again. Hover your mouse over the small green square (the fill handle) in the bottom-right corner of the cell until your cursor changes to a thin black cross. Double-click this fill handle or drag it down to cell D7.

Excel will automatically fill the rest of the "Monthly Segment" column with the correct month numbers:

Transaction ID Date Sales Amount Monthly Segment
T-001 2023-01-15 $120.50 1
T-002 2023-02-28 $210.00 2
T-003 2023-01-05 $75.25 1
T-004 2023-03-10 $150.75 3
T-005 2023-02-01 $99.99 2
T-006 2023-04-20 $300.00 4

This final working formula, =MONTH(B2), has transformed your raw dates into actionable month numbers, ready for further analysis. This immediate practical application is why the MONTH function is a staple in any Excel user's toolkit.

Pro Tips: Level Up Your Skills

The MONTH function, while simple, is a cornerstone for advanced date manipulation. Experienced Excel users prefer to combine it with other functions to unlock deeper insights. Here are a few expert tips to elevate your data analysis.

First, combine with other date functions for detailed date analysis. For instance, you might want to create a unique identifier for each month and year. You could use =TEXT(B2,"yyyymm") or =YEAR(B2)&TEXT(MONTH(B2),"00"). This allows for precise grouping in PivotTables or filtering.

Secondly, consider converting the numerical month to a readable name for reports. While MONTH gives you 1 through 12, you can use =TEXT(B2,"mmmm") or =TEXT(DATE(YEAR(B2),MONTH(B2),1),"mmmm") to display "January" or "Jan". This makes your reports much more user-friendly without losing the underlying numerical month for calculations.

Finally, leverage the MONTH function in conditional formatting rules. For example, to highlight all transactions occurring in a specific month, select your data range, go to Conditional Formatting, and create a new rule using a formula like =MONTH($B2)=3 (to highlight March transactions). This provides an instant visual cue for month-specific trends. These expert techniques, rooted in the versatile MONTH function, provide immediate, actionable advice for better data visualization and organization.

Troubleshooting: Common Errors & Fixes

Even the simplest functions can sometimes throw a curveball. When working with the MONTH function, there are a couple of common errors you might encounter. Don't worry, we've got the fixes ready for you.

1. #VALUE! Error

  • What it looks like: You see #VALUE! displayed in the cell where you expected a month number.
  • Why it happens: This error occurs if the argument provided to the MONTH function is not a valid Excel date serial number. This could be text that Excel can't interpret as a date (e.g., "Invalid Date", "October 35th"), or even an empty cell when a date is expected. Excel needs a recognizable date format to extract the month. In our experience, users sometimes link to cells that contain text comments or error messages themselves.
  • How to fix it: Ensure the serial_number argument refers to a valid date that Excel can understand. Double-check the cell you are referencing (e.g., B2) to make sure it contains a genuine date. If it's a text entry, try converting it to a date first using functions like DATEVALUE or by re-entering the date in a standard format (e.g., "MM/DD/YYYY" or "YYYY-MM-DD"). You can also use ISNUMBER() or ISDATE() in an adjacent cell to validate if your input is indeed a recognized date serial number before applying MONTH.

2. Returning unexpected month if the cell is not formatted as a date.

  • What it looks like: The MONTH function returns a correct-looking number (e.g., 4, for April), but it's not the month you expect based on what you see displayed in the cell. For example, a cell displays "1/15/2023" but MONTH returns 44941 (which it shouldn't if the cell is formatted as a date). A common mistake we've seen is when a cell contains a number that isn't a date serial number, but Excel interprets it. Or, more subtly, if a cell looks like "January" but is actually a general number like 1 or 44941 formatted as a date, it can be confusing.
  • Why it happens: Excel stores dates as serial numbers, counting days from January 1, 1900. If a cell looks like a date but is actually just a regular number, MONTH will treat that number as a date serial number and extract its corresponding month. For instance, if a cell contains the number 44941 (which is the serial number for January 15, 2023) but is formatted as "General", and you apply MONTH to it, it will correctly return 1. The "unexpected" part arises when a non-date number looks like a date due to incorrect cell formatting or when users manually type a simple number (e.g., 1) into a cell, expecting MONTH to understand it as "the first month" without it being a valid date serial number. MONTH(1) will always return 1, because 1 is the serial number for January 1, 1900.
  • How to fix it: Always verify that the input to the MONTH function is a legitimate Excel date. If you've typed 1/15/2023 into a cell, Excel converts it to its serial number (44941). If you simply type 1 into a cell and expect MONTH to understand it as "January" of the current year, it won't; MONTH(1) will yield 1 (for Jan 1, 1900). If your cells appear to be dates but are causing issues, try selecting the problematic cells and going to Home > Number Format and choosing "Short Date" or "Long Date" to ensure Excel recognizes them as actual dates, not just numbers or text that look like dates.

Quick Reference

To ensure you can quickly recall the essence of our MONTH recipe, here's a concise summary:

  • Syntax: MONTH(serial_number)
  • Most Common Use Case: Extracting the numerical month (1-12) from a date for grouping, filtering, or further calculations.
  • Key Gotcha to Avoid: Providing non-date values or text that Excel cannot interpret as a valid date serial number, which can lead to #VALUE! errors or unexpected results. Always ensure your serial_number is a recognized date.
  • Related Functions to Explore:
    • YEAR: Extracts the year from a date.
    • DAY: Extracts the day of the month from a date.
    • DATE: Constructs a date from separate year, month, and day components.
    • TEXT: Formats a date (or number) into a text string with specified formatting (e.g., to get month names).
    • EOMONTH: Returns the last day of the month before or after a specified number of months.
    • EDATE: Returns a date that is a specified number of months before or after a start date.

Mastering the MONTH function empowers you to slice and dice your date data with precision and ease. Happy analyzing!

👨‍💻

Written by The Head Chef

Former 10-year Financial Analyst who survived countless month-end closes. I build these recipes to save you from weekend-ruining spreadsheet errors.

Read the full story →

You might also find these useful 💡