Skip to content

DATEVALUE function

Overview

DATEVALUE is a function of the Date and Time category that converts a date stored as text to a serial number corresponding to a date value.

Usage

Syntax

DATEVALUE(date_text) => datevalue

Argument descriptions

  • date_text (text, required). A text string that represents a date in a known format. The text must represent a date between December 31, 1899 and December 31, 9999.

Additional guidance

  • If the year portion of the date_text argument is omitted, DATEVALUE uses the current year from the system clock.
  • Time information in the date_text argument is ignored. DATEVALUE processes only the date portion.

Returned value

DATEVALUE returns a number that represents the date as a serial number. The serial number corresponds to the number of days since December 31, 1899.

Error conditions

  • In common with many other IronCalc functions, DATEVALUE propagates errors that are found in its argument.
  • If no argument, or more than one argument, is supplied, then DATEVALUE returns the #ERROR! error.
  • If the value of the date_text argument is not (or cannot be converted to) a text value, then DATEVALUE returns the #VALUE! error.
  • If the date_text argument represents a date outside the valid range (before December 31, 1899 or after December 31, 9999), then DATEVALUE returns the #VALUE! error.
  • If the date_text argument cannot be recognized as a valid date format, then DATEVALUE returns the #VALUE! error.
  • For more information about the different types of errors that you may encounter when using IronCalc functions, visit our Error Types page.