Home Privacy Policy Feedback Link to us Site Map Forums

Excel: DateValue Function


In Excel, the DateValue function returns the serial number of a date.

The syntax for the DateValue function is:

DateValue( date )

date is a string representation of a date.


Applies To:

  • Excel 2007, Excel 2003, Excel XP, Excel 2000

For example:

Let's take a look at an example:

Based on the spreadsheet above, the function would return the following values:

=DateValue(A1) would return 37500.
=DateValue(A2) would return 37866.
=DateValue(A3) would return 37955.
=DateValue("30-Nov-2003") would return 37955.

VBA Code

The DateValue function can be used in VBA code. For example:

Dim LDate As Date

LDate = DateValue("May 15, 2003")

In this example, the variable called LDate would now contain the value of 5/15/2003.