DATEVALUE function

Microsoft Office ShapeSheet

DATEVALUE function

Returns the date value represented by datetime or expression.

Syntax

DATEVALUE("datetime"|expression[,lcid])

datetime

Any string commonly recognized as a date and time or a reference to a cell containing a date and time.

expression

Any expression that yields a date and time.

lcid

Optional argument. Specifies the locale identifier to be used in evaluating a nonlocal datetime. The locale identifier is a number described in the system header files.

Remarks

Any time component in datetime or expression is discarded.

If datetime is missing or cannot be converted to a valid result, returns a #VALUE! error.

The returned value is displayed using the short date style set by the system's current Regional Settings.

The DATEVALUE function also accepts a single number value for expression where the integer portion of the result represents the days since December 30, 1899.

Example 1

DATEVALUE(NOW( ))+5 ed.

Returns the date five days from now.

Example 2

DATEVALUE("7/19/1995 12:30")

Returns the date.

Example 3

DATEVALUE("May 33, 1997")

Returns a #VALUE! error.

Example 4

DATEVALUE(35580.6337)

Returns 5/30/1997.