New Tool Radar

AI for Data & Spreadsheets

How to Check Whether an AI-Written Date Formula Parses Text Dates or Treats Them as Text

Check whether an AI-written date formula parses text dates with DATEVALUE, or treats them as text and returns an error.

Schematic with three steps: Check whether the source is a real; Use DATEVALUE for text dates, not TEXT; Test the formula's output type.

A date stored as text, such as “2026-03-15” typed into a cell formatted as text, looks like a date but behaves like text: date arithmetic on it fails and sorting puts it in the wrong order. DATEVALUE converts a text date into a real date, while TEXT does the opposite and formats a real date as text. An AI-written formula can use the wrong one and silently produce text where a date was needed. Check the cell type before the formula.

What you need

  • The AI-written date formula
  • The source cells, with their types checked
  • The date the formula should return

Step 1: Check whether the source is a real date or text

Select a source cell and look at the formula bar: a real date is right-aligned and shows as a date, while text is left-aligned. Use ISTEXT in a spare cell if the alignment is unclear.

Step 2: Use DATEVALUE for text dates, not TEXT

If the source is text, wrap it in DATEVALUE to get a real date before doing arithmetic. If the source is already a date, use TEXT only when the output should be displayed as text.

Step 3: Test the formula’s output type

Run the corrected formula and check the result with ISNUMBER: a real date returns TRUE, while text returns FALSE. Sort the output column and check that the dates fall in calendar order.

Worked example: synthetic text date plus 30 days

The table below is a synthetic example. It shows the expected result of checking an AI-written date formula; no formula was run.

Check Value Result
Source cell “2026-03-15” Stored as text
Formula as written =A2+30 Adds 30 to text
Result as written #VALUE! Text cannot be added
Corrected formula =DATEVALUE(A2)+30 Returns 2026-04-14

Expected result (UNTESTED). =A2+30 on the text date returns #VALUE!, because text cannot be added; =DATEVALUE(A2)+30 returns 2026-04-14, a real date. This check was not run live; the table shows the expected result for the synthetic example.

Limits

  • DATEVALUE fails on text that is not a recognisable date, such as “15 March” without a year in some locales.
  • TEXT turns a date into text, so a TEXT result cannot be used in date arithmetic without converting it back.
  • A date that looks like text may actually be a real date in a text format, so check with ISTEXT rather than by eye.
  • Two-digit years in text dates are interpreted by the locale’s rules, which can put the date in the wrong century.

Sources

See all