Function Problems

Convert YYYYMM Values to Month-Year Dates in Excel

Kushani NimanthikaKushani Nimanthika Nov 12, 2026 869 views

Question details

Convert a YYYYMM value, such as 199903, into a month-year display or a real date value.

Convert YYYYMM Values to Month-Year Dates in Excel
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.
Before you start

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.

Solution 1Recommended

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.

1
Enter the date conversion formula

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.

2
Format the result as month and year

Select the result cells, press Ctrl+1 to open Format Cells, choose Custom, enter mmm-yyyy in the Type box, and select OK.

3
Fill the formula down

Drag the fill handle from the lower-right corner of B1 down the column to convert the remaining YYYYMM values.

Create a real Excel date and apply a month-year format
The result is a real date: A value such as 199903 becomes March 1, 1999 internally, while the mmm-yyyy format displays it as Mar-1999.
Work with dates in WPS Spreadsheets

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. 1. Open the worksheet in WPS Spreadsheets: Open the workbook and select the first empty cell beside the YYYYMM source column.
  2. 2. Build a real date: Enter =DATE(LEFT(A1,4),RIGHT(A1,2),1), replacing A1 with the source cell, then press Enter.
  3. 3. Set the month-year display: Select the converted cells, open Home > Number Format > More Number Formats, choose Custom, and enter mmm-yyyy.
  4. 4. Fill the conversion down: Drag the fill handle down the output column to convert each remaining YYYYMM value.
Convert YYYYMM values into sortable and calculable date values with DATE formulas.Apply custom month-year formats such as mmm-yyyy in WPS Spreadsheets.Open and edit Microsoft Excel .xlsx and .xls workbooks with compatible spreadsheet formulas.Use a familiar, lightweight spreadsheet interface for date cleanup and analysis.
microsoft office alternative - wps office

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.