0% found this document useful (0 votes)
17 views

Excel date functions with formula examples

Uploaded by

Menia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Excel date functions with formula examples

Uploaded by

Menia
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Excel date functions with formula examples

Microsoft Excel provides a ton of functions to work with dates and times. Each function
performs a simple operation and by combining several functions within one formula you can
solve more complex and challenging tasks.

In the previous 12 parts of our Excel dates tutorial, we have studied the main Excel date
functions in detail. In this final part, we are going to summarize the gained knowledge and
provide links to a variety the formula examples to help you find the function best suited for
calculating your dates.

The main function to calculate dates in Excel:

 DATE function

Get current date and time:

 TODAY - returns today's date


 NOW - returns the current date and time

Convert dates to / from text:

 DATEVALUE - converts a date in the text format to date format


 TEXT - converts a date to a text value

Retrieve dates in Excel:

 DAY - returns the day of the month


 MONTH - returns the month of a specified date
 YEAR - returns the year of a specified date
 EOMONTH - returns the last day of the month
 WEEKDAY - returns the day of the week
 WEEKNUM - returns the week number of a date

Calculate date difference:

 DATEDIF - returns the difference between two dates


 EDATE - returns a date N months before or after the start date
 YEARFRAC - calculates the fraction of the year between 2 dates

Calculate workdays:

 WORKDAY - returns a date N working days in the future or in the past


 WORKDAY.INTL - returns a date N weekdays from the start date with custom
weekends
 NETWORKDAYS - returns the number of workdays between two dates
 NETWORKDAYS.INTL - returns the number of workdays between two dates with
custom weekends
Excel DATE function
DATE(year, month, day) returns a serial number of a date based on the year, month and
day values that you specify.

When it comes to working with dates in Excel, DATE is the most essential function to
understand. The point is that other Excel date functions not always can recognize dates
entered in the text format. So, when performing date calculations in Excel, you'd better
supply dates using the DATE function to ensure the correct results.

Here are a few Excel DATE formula examples:

=DATE(2015, 5, 20) - returns a serial number corresponding to 20-May-2015.

=DATE(YEAR(TODAY()), MONTH(TODAY()), 1) - returns the first day of the current year and
month.

=DATE(2015, 5, 20)-5 - subtracts 5 days from May 20, 2015.

At first sight, the Excel DATE function looks very simple, however, it does have a number of
specificities pointed out in the Excel DATE tutorial.

Below you will find a few more examples where the Excel DATE function is part of bigger
formulas:

 Subtracting two dates in Excel


 Adding or subtracting days to a date
 Calculate the number of days in a month

Excel TODAY function


The TODAY() function returns today's date, exactly as its name suggests.

TODAY is arguably one of the easiest Excel functions to use because it has no arguments at
all. Whenever you need to get today's date in Excel, enter the following formula is a cell:

=TODAY()
Apart from this obvious use, the Excel TODAY function can be part of more complex
formulas and calculations based on today's date. For example, to add 7 days to the current
date, enter the following formula in a cell:

=TODAY()+7

To add 30 weekdays to today's date excluding weekend days, use this one:

=WORKDAY(TODAY(), 30)

Note. The date returned by the TODAY function in Excel updates automatically when your
worksheet is recalculated to reflect the current date.

For more formula examples demonstrating the use of the TODAY function in Excel, please
check out the following tutorials:

 Excel TODAY function to insert today's date and more


 Convert today's date to text format
 Calculate weekdays based on today's date
 Find the 1st day of month based on today date

Excel NOW function


NOW() function returns the current date and time. As well as TODAY, it does not have any
arguments. If you wish to display today's date and current time in your worksheet, simply put
the following formula in a cell:

=NOW()

Note. As well as TODAY, Excel NOW is a volatile function that refreshes the returned value
every time the worksheet is recalculated. Please note, the cell with the NOW() formula does
not auto update in real-time, only when the workbook is reopened or the worksheet is
recalculated. To force the spreadsheet to recalculate, and consequently get your NOW
formula to update its value, press either Shift+F9 to recalculate only the active worksheet or
F9 to recalculate all open workbooks.

For more details, please see How to use NOW function in Excel.

Excel DATEVALUE function


DATEVALUE(date_text) converts a date in the text format to a serial number that represents a
date.
The DATEVALUE function understands plenty of date formats as well as references to cells
that contain "text dates". DATEVALUE comes in really handy to calculate, filter or sort dates
stored as text and convert such "text dates" to the Date format.

A few simple DATEVALUE formula examples follow below:

=DATEVALUE("20-may-2015")

=DATEVALUE("5/20/2015")

=DATEVALUE("may 20, 2015")

And the following examples demonstrate how the DATEVALUE function can help with
solving real-life tasks:

 DATEVALUE formula to convert a date to a number


 DATEVALUE formula to convert a text string to a date

You might also like