CodeSteps

Python, C, C++, C#, PowerShell, Android, Visual C++, Java ...

Microsoft Excel – DATE functions

DATE function and related functions are important functions to deal with date-related data in Excel.

DATE function

This function returns the date by taking individual date components (year, month & day) as its arguments. Using DATE function we can form the date-time code using the individual date components.

Syntax:

DATE(year, month, day)

DATE function is very useful when converting the unidentified date format to the recognized date format. We need to first split the unidentified date format into individual date components and then combine the components to form a proper date format using this function.

FormulaResult
DATE(2019, 4, 14)14-04-2019
DATE(0, 0, 0)#NUM!
DATE(0, 1, 1)01-01-1900

YEAR function

This function extracts the year component from the date and returns the year value.

Syntax:

YEAR(date-time code)

FormulaResult
YEAR(NOW())2019
YEAR(0)1900

MONTH function

When passing the date value through this function, it returns its month value of it.

Syntax:

MONTH(date-time code)

FormulaResult
MONTH(NOW())04
MONTH(0)1

DAY function

A day value will be returned by this function. It takes date value as an argument.

Syntax:

DAY(date-time code)

FormulaResult
DAY(NOW())14
DAY(0)0

DATEVALUE function

When we pass a date as a text through its argument, it converts into a date serial number, a date-time code.

Syntax:

DATEVALUE(date-time value in text format)

FormulaResult
DATEVALUE(“14-04-2019”)43569
DATEVALUE(NOW())#VALUE!
DATEVALUE(TEXT(NOW(), “YYYY-MM-DD”))43569

🙂 Sahida

Microsoft Excel – DATE functions

2 thoughts on “Microsoft Excel – DATE functions

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top