How can I check if a cell contains a date in Excel? 2

How can I check if a cell contains a date in Excel?

To check if a cell contains a date in Excel, you can use the DATEVALUE function. This function converts a date in text format to a numerical value, which Excel recognizes as a date. Simply enter the cell reference or date in quotation marks as the argument for the function. If the cell contains a valid date, the function will return a numerical value. If it is not a date, it will return an error. This allows you to easily identify and verify if a cell contains a date in Excel.

Excel: Check if Cell Contains Date


You can use the following formula to check if a specific cell in Excel contains a valid date:

=ISNUMBER(DATEVALUE(A2))

This particular example checks if cell A2 contains a valid date.

If it does, then the formula returns TRUE.

Otherwise, the formula returns FALSE.

Note that the function DATEVALUE converts a text date into a serial number.

If this function is unable to convert a text date into a serial number, then #VALUE! is returned.

We then wrap this function with the ISNUMBER() function to determine if the cell contains a number or not and return TRUE or FALSE as a result.

The following example shows how to use this formula in Excel.

Example: Check if Cell Contains Date in Excel

Suppose we have the following list of text values in Excel:

Note: It’s important that the values in column A are formatted as text before using the formula.

We’ll use the following formula to check if each cell in column A contains a valid date:

=ISNUMBER(DATEVALUE(A2))

We’ll type this formula into cell B2 and then copy and paste it down to every remaining cell in column B:

Excel check if cell is date

For example, we can see:

  • “Hey” is not a valid date.
  • “10/14/2023” is a valid date.
  • “10/32/2023” is not a valid date since October 32nd doesn’t exist.
  • “12/25/2023” is a valid date.
  • “14/10/2023” is not a valid date since there are not 14 months in a year.
  • “1/12/2023” is not a valid date.

If you would like to return values other than TRUE or FALSE, you can wrap the formula in an IF function:

=IF(ISNUMBER(DATEVALUE(A2)), "Valid", "Not Valid")

We’ll type this formula into cell B2 and then copy and paste it down to every remaining cell in column B:

Each value in column B now returns “Valid” or “Not Valid” to indicate if the value in the corresponding cell in column A is a valid date.

The following tutorials explain how to perform other common tasks in Excel:

Cite this article

stats writer (2024). How can I check if a cell contains a date in Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-check-if-a-cell-contains-a-date-in-excel/

stats writer. "How can I check if a cell contains a date in Excel?." PSYCHOLOGICAL SCALES, 24 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-check-if-a-cell-contains-a-date-in-excel/.

stats writer. "How can I check if a cell contains a date in Excel?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-check-if-a-cell-contains-a-date-in-excel/.

stats writer (2024) 'How can I check if a cell contains a date in Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-check-if-a-cell-contains-a-date-in-excel/.

[1] stats writer, "How can I check if a cell contains a date in Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.

stats writer. How can I check if a cell contains a date in Excel?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top