Convert YYYYMM Values to Month-Year Dates in Excel
Question details
Convert a YYYYMM value, such as 199903, into a month-year display or a real date value.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user needs to transform year-month codes into dates that can be displayed as Mar-1999 and used in worksheet operations.
- Observed behavior
- YYYYMM values are stored as numbers or text rather than recognized Excel dates.
Confirm that each source value has six digits in YYYYMM order and that the month portion is between 01 and 12. Use a separate output column so the original codes remain available for verification.
Create a real Excel date and apply a month-year format
Use this method when the converted values must sort chronologically, support date formulas, and work correctly in filters and PivotTables.
The DATE formula creates a true date using the year and month extracted from the YYYYMM code. Formatting the result as mmm-yyyy changes only its appearance; the underlying value remains a usable date.
In an empty cell such as B1, enter =DATE(LEFT(A1,4),RIGHT(A1,2),1), where A1 contains the YYYYMM value, and press Enter.
Select the result cells, press Ctrl+1 to open Format Cells, choose Custom, enter mmm-yyyy in the Type box, and select OK.
Drag the fill handle from the lower-right corner of B1 down the column to convert the remaining YYYYMM values.

Return only a formatted month-year text result
Use this option when you only need a label such as Mar-1999 and do not need the output for date calculations or chronological sorting.
Convert YYYYMM Codes into Usable Month-Year Dates with WPS Spreadsheets
WPS Spreadsheets supports the same DATE, LEFT, RIGHT, and TEXT formulas needed to convert YYYYMM codes into real dates. Format the resulting cells as mmm-yyyy to show a clean month-year label while retaining date functionality.
- 1. Open the worksheet in WPS Spreadsheets: Open the workbook and select the first empty cell beside the YYYYMM source column.
- 2. Build a real date: Enter =DATE(LEFT(A1,4),RIGHT(A1,2),1), replacing A1 with the source cell, then press Enter.
- 3. Set the month-year display: Select the converted cells, open Home > Number Format > More Number Formats, choose Custom, and enter mmm-yyyy.
- 4. Fill the conversion down: Drag the fill handle down the output column to convert each remaining YYYYMM value.

Frequently Asked Questions
Why does Excel show a number instead of Mar-1999 after I use the DATE formula?
The formula creates a valid date serial number. Select the result cells, press Ctrl+1, choose Custom, and use the format mmm-yyyy to display the month and year.
Can I sort YYYYMM values after converting them with TEXT?
TEXT returns a text label, so chronological sorting can be unreliable in some cases. Use =DATE(LEFT(A1,4),RIGHT(A1,2),1) and format the result as mmm-yyyy for reliable date sorting.
What date is created from a value such as 199903?
The formula =DATE(LEFT(A1,4),RIGHT(A1,2),1) creates March 1, 1999. The day is set to 1 because the original YYYYMM value does not include a day.
Does the formula work when YYYYMM is stored as text?
Yes. LEFT and RIGHT can extract the year and month from either a six-digit number or text value, and DATE converts the extracted parts into a real date.




