Function Problems

Fix Excel TEXT Function Formatting for Date Strings

Algirdas JasaitisAlgirdas Jasaitis Nov 18, 2026 870 views

Question details

The user wants to format a date as yyyymmdd with Excel's TEXT function.

Fix Excel TEXT Function Formatting for Date Strings
Product
Microsoft Excel
Device & OS
not provided
Scenario
A formula passes a quoted date string to TEXT, or the source date is stored as text.
Observed behavior
TEXT returns the original date string instead of the expected yyyymmdd result.
Before you start

Check whether the source cell contains a real Excel date or a text string. Identify the intended day and month before converting an ambiguous date such as 2/11/2022.

Solution 1Recommended

Use a real date value with the TEXT function

Use this method when you know the date components or the source cell already contains a real Excel date.

1
Construct the date

In an empty cell, enter =TEXT(DATE(2022,11,2),"yyyymmdd") and press Enter. The result is 20221102.

2
Reference an existing date cell

If A1 contains a real Excel date, enter =TEXT(A1,"yyyymmdd") in another cell. Do not put quotation marks around A1.

3
Check the source value

If the formula still does not produce the expected result, select the source cell and check whether it contains a text date. Convert the text to a real date before applying TEXT.

Use a real date value with the TEXT function
TEXT returns text: The yyyymmdd result is a text string, not a date value for date calculations. Keep the original date cell if you need to perform calculations.
WPS Spreadsheet

Format a date as yyyymmdd in WPS Spreadsheet

Use DATE and TEXT in WPS Spreadsheet to construct an unambiguous date and return it in yyyymmdd format.

  1. 1. Open a spreadsheet: Open WPS Spreadsheet and create a blank workbook or open an existing Excel file.
  2. 2. Enter the formula: Select an empty cell and enter =TEXT(DATE(2022,11,2),"yyyymmdd").
  3. 3. Check the result: Press Enter and confirm that the cell displays 20221102.
  4. 4. Use a date cell instead: If A1 contains a real date, enter =TEXT(A1,"yyyymmdd") in an empty cell to format that value.
Construct dates without relying on ambiguous regional date stringsFormat date values as yyyymmdd with TEXTOpen and edit Microsoft Excel XLSX and XLS filesWork in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't TEXT format my quoted date correctly?

A quoted date is text, and its interpretation can depend on regional settings. Use DATE to construct the value explicitly, such as =TEXT(DATE(2022,11,2),"yyyymmdd").

Should I put quotation marks around a cell reference?

No. Use =TEXT(A1,"yyyymmdd"), not =TEXT("A1","yyyymmdd"). Quotation marks make A1 literal text rather than a cell reference.

How can I convert dates stored as text in Excel?

Select the cells and choose Data > Text to Columns. At the column data format step, select Date and the order that matches the source text, then click Finish.

Can I calculate with the result of TEXT?

TEXT returns a text string. Use the original date value for date calculations and the TEXT result for display or export.