DATEVALUE() returns #VALUE despite text format. DATE() returns #REF despite number format

Anonymous
2022-11-12T04:21:26+00:00

I am trying to convert a string date (ie. "19/07/2021") to date format. I have tried the following steps:

  1. DATEVALUE returns a #VALUE error, although I have used ISTEXT to verify that the target cell is in fact text format
  2. I have split the text into separate Year (2021), Month (07), Day (19) columns (19), and used ISNUMBER to verify that each column is in fact number format. Then I tried DATE(Year,Month,Day), but this returns a #REF error.
Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Ashish Mathur 102.2K Reputation points Volunteer Moderator
2022-11-13T00:09:40+00:00

Hi,

This is because your system's date format is set to MM/DD/YYYY. Therefore 19/7/2021 is not recognised as a Date. You should use Data > Text to columns > Next > Next > Date > MDY > Finish to convert the text date into a proper date.

Hope this helps.

Was this answer helpful?

0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2022-11-13T04:00:13+00:00

    This solved it. Thanks so much, such a simple fix!

    Was this answer helpful?

    0 comments No comments
  2. HansV 462.6K Reputation points MVP Volunteer Moderator
    2022-11-12T14:18:21+00:00

    Have you perhaps created a defined name called Date?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2022-11-12T13:12:31+00:00

    Thanks for the response. This is exactly what I had tried already, and described in point number 2 in my post. Strangely the Date function returns a #REF error.

    Was this answer helpful?

    0 comments No comments
  4. HansV 462.6K Reputation points MVP Volunteer Moderator
    2022-11-12T11:18:47+00:00

    Let's say you have 19/07/2021 in cell A2.

    In another cell, for example B2:

    =DATE(RIGHT(A2, 4), MID(A2, 4, 2), LEFT(A2, 4))

    Format the cell with the formula as a date.

    Remark: if you use comma as decimal separator, use semicolons ; instead of commas between the arguments of the functions.

    Was this answer helpful?

    0 comments No comments