# How to convert a month name to a number in Excel

Turn the name into a date and take its month: `=MONTH(DATEVALUE(A2&" 1"))`.

**Excel:** `=MONTH(DATEVALUE(A2&" 1"))` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Month | Number |
| March |  |
| September |  |
| Dec |  |
| Apr |  |
| July |  |

Formula in B2, filled to B6: `=MONTH(DATEVALUE(A2&" 1"))`

Result: 3; 9; 12; 4; 7

## How it works

Joining " 1" turns "March" into "March 1", which DATEVALUE reads as March 1 of the current year. MONTH then returns its month number. Full names and three-letter abbreviations both work.

## Other ways

- `=MATCH(LEFT(A2,3),{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"},0)`: Looks up the first three letters, so it doesn't depend on date parsing.
- `=MONTH(A2&" 1")`: Shorter: MONTH converts the text itself.

## Common mistakes

- Month names must be in the spreadsheet's language: "Mars" fails in an English locale.
- Extra spaces or "Sept." may not parse. TRIM the text, or use the MATCH version on the first three letters.

## Questions

**How do I convert a month number to a name?**

`=TEXT(DATE(2026,A2,1),"mmmm")`.

**How do I sort month names in calendar order?**

Sort by the number: `=SORTBY(A2:A6,MONTH(A2:A6&" 1"),1)`.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/convert-a-month-name-to-a-number
