Description
Use this function to return the numeric date value for a date written in either year/month/day or month/day/year format. Supported in Chains.
Syntax
DATEVALUE(YYYY/MM/DD)
orDATEVALUE(MM/DD/YYYY)
Inputs
This function has the following arguments:
Name | Required | Valid input |
---|---|---|
year |
Yes | A four-digit year. (A two-digit year is presumed to be prefixed with "19".) This must be an integer or a formula which results in an integer in the range 1900–9999. |
month |
Yes | A two-digit month. (A single digit is acceptable.) This must be an integer or a formula which results in an integer in the range 1–12. |
day |
Yes | A two-digit day (A single digit is acceptable.) This must be an integer or a formula which results in an integer in the range 1–31. |
Examples
Sample data
Date |
---|
2021/06/03 |
2021/06/03 |
12/19/2021 |
Sample formulas
Formula | Description | Display | Value |
---|---|---|---|
=DATEVALUE("2021/06/03") |
Returns the value of the specified date. | 44261 | 3 June 2021 |
=DATEVALUE("1960/08/06")-45 |
Returns the value the date 45 days before the specified date. | 22134 | 6/22/1960 (45 days prior to the date entered) |
=DATEVALUE(A3)+28 |
Returns the value the date 28 days after the specified date. | #VALUE! | N/A (cell references are not supported) |
Notes
- The entire date must be in quotation marks.
- Cell references aren't supported.
Tips
- Applying a "Date" format to the cell will display the date in MM/DD/YYYY format.
Related Functions
DATE
DATEVALUE
DAY
DAYS
DAYS360
EDATE
EOMONTH
MONTH
NETWORKDAYS
NETWORKDAYS.INTL
WEEKDAY
WORKDAY
WORKDAY.INTL
YEAR
YEARFRAC