Excel Office

Excel How Tos, Tutorials, Tips & Tricks, Shortcuts

Category: Date and Time Functions

Excel Date and Time Functions return a dynamic date or time in a cell.

NETWORKDAYS.INTL function: Description, Usage, Syntax, Examples and Explanation

What is NETWORKDAYS.INTL function in Excel? NETWORKDAYS.INTL function is one of Date and Time functions in Microsoft Excel that returns the number of whole workdays between two dates using parameters to indicate which and how many days are weekend days. Weekend days and any days that are specified as holidays are not considered as workdays. Syntax of NETWORKDAYS.INTL function NETWORKDAYS.INTL(start_date, end_date, [weekend],…

DATE function: Description, Usage, Syntax, Examples and Explanation

What is DATE function in Excel? DATE function is one of Date and Time functions in Microsoft Office Excel that when you need to take three separate values and combine them to form a date. Note: Microsoft Excel DATE function returns the serial date value for a date. Syntax of DATE function The syntax for the DATE function in Microsoft Excel is: DATE( year,…

TODAY function: Description, Usage, Syntax, Examples and Explanation

What is TODAY function in Excel? TODAY function is one of  Date and Time functions in Microsoft Excel that returns the serial number of the current date. The serial number is the date-time code used by Excel for date and time calculations. If the cell format was General before the function was entered, Excel changes the cell format to Date. If you want to…

TIMEVALUE function: Description, Usage, Syntax, Examples and Explanation

What is TIMEVALUE function in Excel? TIMEVALUE function is one of  Date and Time functions in Microsoft Excel that returns the decimal number of the time represented by a text string. The decimal number is a value ranging from 0 (zero) to 0.99988426, representing the times from 0:00:00 (12:00:00 AM) to 23:59:59 (11:59:59 P.M.). Syntax of TIMEVALUE function TIMEVALUE(time_text) The TIMEVALUE function…

TIME function: Description, Usage, Syntax, Examples and Explanation

What is TIME function in Excel? TIME function is one of  Date and Time functions in Microsoft Excel that returns the decimal number for a particular time. If the cell format was General before the function was entered, the result is formatted as a date. The decimal number returned by TIME is a value ranging from 0 (zero) to 0.99988426, representing the times…

NOW function: Description, Usage, Syntax, Examples and Explanation

What is NOW function in Excel? NOW function is one of  Date and Time functions in Microsoft Excel that returns the serial number of the current date and time. If the cell format was General before the function was entered, Excel changes the cell format so that it matches the date and time format of your regional settings. You can change the date…

WEEKDAY function: Description, Usage, Syntax, Examples and Explanation

What is WEEKDAY function in Excel? WEEKDAY function is one of Date and Time functions in Microsoft Excel that returns the day of the week corresponding to a date. The day is given as an integer, ranging from 1 (Sunday) to 7 (Saturday), by default. Syntax of WEEKDAY function WEEKDAY(serial_number,[return_type]) The WEEKDAY function syntax has the following arguments: Serial_number:  A sequential number that…

WEEKNUM function: Description, Usage, Syntax, Examples and Explanation

What is WEEKNUM function in Excel? WEEKNUM function is one of Date and Time functions in Microsoft Excel that returns the week number of a specific date. For example, the week containing January 1 is the first week of the year, and is numbered week 1. There are two systems used for this function: System 1    The week containing January 1 is the…

SECOND function: Description, Usage, Syntax, Examples and Explanation

What is SECOND function in Excel? SECOND function is one of Date and Time functions in Microsoft Excel that returns the seconds of a time value. The second is given as an integer in the range 0 (zero) to 59. Syntax of SECOND function SECOND(serial_number) The SECOND function syntax has the following arguments: Serial_number    Required. The time that contains the seconds you want to…

WORKDAY.INTL function: Description, Usage, Syntax, Examples and Explanation

What is WORKDAY.INTL function in Excel? WORKDAY.INTL function is one of Date and Time functions in Microsoft Excel that returns the serial number of the date before or after a specified number of workdays with custom weekend parameters. Weekend parameters indicate which and how many days are weekend days. Weekend days and any days that are specified as holidays are not considered…

WORKDAY function: Description, Usage, Syntax, Examples and Explanation

What is WORKDAY function in Excel? WORKDAY function is one of Date and Time functions in Microsoft Excel that returns a number that represents a date that is the indicated number of working days before or after a date (the starting date). Working days exclude weekends and any dates identified as holidays. Use WORKDAY to exclude weekends or holidays when you calculate…

YEAR function: Description, Usage, Syntax, Examples and Explanation

What is YEAR function in Excel? YEAR function is one of Date and Time functions in Microsoft Excel that returns the year corresponding to a date. The year is returned as an integer in the range 1900-9999. Syntax of YEAR function YEAR(serial_number) The YEAR function syntax has the following arguments: Serial_number: The date of the year you want to find. Dates should be…

YEARFRAC function: Description, Usage, Syntax, Examples and Explanation

What is DATEDIF function in Excel? DATEDIF function is one of Date and Time functions in Microsoft Excel that calculates the fraction of the year represented by the number of whole days between two dates (the start_date and the end_date). For instance, you can use YEARFRAC to identify the proportion of a whole year’s benefits, or obligations to assign to a specific term. Syntax of DATEDIF function YEARFRAC(start_date, end_date,…

DATEDIF function: Description, Usage, Syntax, Examples and Explanation

What is DATEDIF function in Excel? DATEDIF function is one of Date and Time functions in Microsoft Excel that calculates the number of days, months, or years between two dates. Warning: Excel provides the DATEDIF function in order to support older workbooks from Lotus 1-2-3. The DATEDIF function may calculate incorrect results under certain scenarios. Syntax of DATEDIF function DATEDIF(start_date,end_date,unit) Start_date:     A date that…

DATEVALUE function: Description, Usage, Syntax, Examples and Explanation

What is DATEVALUE function in Excel? DATEVALUE function is one of Date and Time functions in Microsoft Excel that converts a date that is stored as text to a serial number that Excel recognizes as a date. For example, the formula =DATEVALUE(“1/1/2008”) returns 39448, the serial number of the date 1/1/2008. Remember, though, that your computer’s system date setting may cause the results of a DATEVALUE function…

DAY function: Description, Usage, Syntax, Examples and Explanation

What is DAY function in Excel? DAY function is one of Date and Time functions in Microsoft Excel that returns the day of a date, represented by a serial number. The day is given as an integer ranging from 1 to 31. Syntax of DAY function DAY(serial_number) The DAY function syntax has the following arguments: Serial_number: The date of the day you are…

DAYS360 function: Description, Usage, Syntax, Examples and Explanation

What is DAYS360 function in Excel? DAYS360 function is one of Date and Time functions in Microsoft Excel that returns the number of days between two dates based on a 360-day year (twelve 30-day months), which is used in some accounting calculations. Use this function to help compute payments if your accounting system is based on twelve 30-day months. Syntax of DAYS360 function…

EDATE function: Description, Usage, Syntax, Examples and Explanation

What is EDATE function in Excel? EDATE function is one of Date and Time functions in Microsoft Excel that returns the serial number that represents the date that is the indicated number of months before or after a specified date (the start_date). Use EDATE to calculate maturity dates or due dates that fall on the same day of the month as the date…

EOMONTH function: Description, Usage, Syntax, Examples and Explanation

What is EOMONTH function in Excel? EOMONTH function is one of Date and Time functions in Microsoft Excel that returns the serial number for the last day of the month that is the indicated number of months before or after start_date. Use EOMONTH to calculate maturity dates or due dates that fall on the last day of the month. Syntax of EOMONTH function…

HOUR function: Description, Usage, Syntax, Examples and Explanation

What is HOUR function in Excel? HOUR function is one of Date and Time functions in Microsoft Excel that returns the hour of a time value. The hour is given as an integer, ranging from 0 (12:00 A.M.) to 23 (11:00 P.M.). Syntax of HOUR function HOUR(serial_number) The HOUR function syntax has the following arguments: Serial_number: The time that contains the hour you…

ISOWEEKNUM function: Description, Usage, Syntax, Examples and Explanation

What is ISOWEEKNUM function in Excel? ISOWEEKNUM function is one of Date and Time functions in Microsoft Excel that returns number of the ISO week number of the year for a given date. Syntax of ISOWEEKNUM function ISOWEEKNUM(date) The ISOWEEKNUM function syntax has the following arguments. Date: Date is the date-time code used by Excel for date and time calculation. ISOWEEKNUM formula explanation…

MINUTE function: Description, Usage, Syntax, Examples and Explanation

What is MINUTE function in Excel? MINUTE function is one of Date and Time functions in Microsoft Excel that returns the minutes of a time value. The minute is given as an integer, ranging from 0 to 59. Syntax of MINUTE function MINUTE(serial_number) The MINUTE function syntax has the following arguments: Serial_number: The time that contains the minute you want to find. Times…

MONTH function: Description, Usage, Syntax, Examples and Explanation

What is MONTH function in Excel? MONTH function is one of Date and Time functions in Microsoft Excel that returns the month of a date represented by a serial number. The month is given as an integer, ranging from 1 (January) to 12 (December). Syntax of MONTH function MONTH(serial_number) The MONTH function syntax has the following arguments: Serial_number    Required. The date of the month…

NETWORKDAYS function: Description, Usage, Syntax, Examples and Explanation

What is NETWORKDAYS function in Excel? NETWORKDAYS function is one of Date and Time functions in Microsoft Excel that returns the number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays. Use NETWORKDAYS to calculate employee benefits that accrue based on the number of days worked during a specific term. Tip:  To…

DAYS function: Description, Usage, Syntax, Examples and Explanation

What is DAYS function in Excel? DAYS function is one of Date and Time functions in Microsoft Excel that returns the number of days between two dates. Syntax of DAYS function DAYS(end_date, start_date) The DAYS function syntax has the following arguments. End_date    Required. Start_date and End_date are the two dates between which you want to know the number of days. Start_date   Required. Start_date and…

How to calculate next day of week in Excel

To return the next specific day of week (i.e. the next Wednesday, or Friday, or Monday) with a given start date, you can use a formula based on the WEEKDAY function. Formula =date+7-WEEKDAY(date+7-dow) Explanation  In the example shown, the formula in D6 is: =B6+7-WEEKDAY(B6+7-2) Where B6 contains the date Friday, January 16, 2015, and 2 represents Monday, the “dow”. The result is Monday, January…

How to calculate next scheduled event in Excel

To get the next scheduled event from a list of events with dates, you can use an array formula based on the MIN and TODAY functions to find the next date, and INDEX and MATCH  to display the event on that date. Formula {=MIN(IF((range>=TODAY()),range))} Note: this is an array formula and must be entered with Control + Shift + Enter. Explanation In…

How to calculate most recent day of week in Excel

If you want to find the most recent Wednesday, or Saturday, or Monday, given a specific start date, you can use a formula that uses the MOD function. Formula =date-MOD(date-dow,7) Note: If the the date has the same day of week, date will be returned. Explanation   Formulas that use the concept of “day of week” are based on the…

How to calculate months between dates in Excel

To calculate months between two dates as a whole number, you can use the DATEDIF function. Formula =DATEDIF(start_date,end_date,”m”) Explanation In the example shown, the formula in D6 is: =DATEDIF(B6,C6,”m”) Note that the DATEDIF automatically rounds down. To round up to the nearest month, see below. The mystery of DATEDIF The DATEDIF function is a “compatibility” function that comes from Lotus…

How to calculate nth day of week in month in Excel

To get the nth day if week in a month (i.e. the first Tuesday, third Tuesday, forth Thursday, etc.) you can use a formula based on the DAY and WEEKDAY functions. Formula =date-DAY(date)+1+n*7-WEEKDAY(date-DAY(date)+8-dow) Note:  Day of week is abbreviated “dow” in the generic form of the formula. This is a number between 1 (Sunday) and 7 (Saturday) which can be changed…

How to calculate percent of year complete in Excel

If you need to calculate the percent remaining in a year, based on a given date, you do so with a formula based on the YEARFRAC function. Formula =YEARFRAC(DATE(YEAR(date),1,1),date) Explanation In the example, the formula in C5, which calculates percentage of year remaining, is: =YEARFRAC(DATE(YEAR(B5),1,1),B5) How the formula works the YEARFRAC function takes two dates, a start date and and…

How to calculate nth day of year in Excel

To get the nth day of year based on a given date, you can use a formula based on the DATE and YEAR functions. Formula =date-DATE(YEAR(date),1,0) Explanation In the example shown, the formula in C5 is: =B4-DATE(YEAR(B4),1,0) With the date “June 1, 2016” in cell B4, the formula returns 153, since June 1st is the 153rd day of that year. How the…

How to calculate project start date based on end date in Excel

To calculate a project start date or custom date based on an end date and duration in days, you can use the WORKDAY function. Note: WORKDAY function does not count the start date as a workday. Formula =WORKDAY(start,-days,holidays) Explanation In the example shown, the formula in E5 is: =WORKDAY(C5,-D5,holidays) where “holidays” is the named range G5:G9. How this formula works This formula…

How to calculate quarter from date in Excel

If you want to calculate the quarter (i.e. 1,2,3,4) from a date, you can use the ROUNDUP function together with MONTH. Formula =ROUNDUP(MONTH(date)/3,0) Explanation In the example shown, the formula in cell C5 is: =ROUNDUP(MONTH(B5)/3,0) How this formula works In this case, the formula first extracts the month as a number between 1-12, then divides this number by 3. The…

How to get same date next month or previous month in Excel

To get the same date next month from a given date, you can use the EDATE function. Formula =EDATE(date,1) Explanation In the example shown, the formula in cell B5 is: =EDATE(B5,1) How this formula works EDATE can get the “same date” in the future or past, based on the number of months supplied. When 1 is given for months, EDATE…

How to get same date next year or previous year in Excel

To get the same date next year from a given date, you can use the EDATE function. Formula =EDATE(date,12) Explanation In the example shown, the formula in cell B5 is: =EDATE(B5,12) EDATE can get the “same date” in the future or past, based on the number of months supplied. When 12 is given for months, EDATE gets the same date…

Get project midpoint in Excel

To calculate an approximate project midpoint date, you can use the WORKDAY function. Note: The WORKDAY function returns a date in the future or past, based on a start date, workdays, and optional holidays. WORKDAY automatically excludes weekends, and counts only Monday through Friday as workdays. Formula =WORKDAY(start,days/2,holidays) Explanation In the example shown, the formula in E5 is: =WORKDAY(C5,E5/2,holidays) where “holidays” is…

Get project end date in Excel

To calculate a project end date based on a start date and duration, you can use the WORKDAY function. Formula =WORKDAY(start,days,holidays) Explanation In the example shown, the formula in E5 is: =WORKDAY(C5,D5,holidays) where “holidays” is the named range G5:G9. How this formula works This formula uses the WORKDAY function to calculate an end date. WORKDAY can calculate dates in the future or past,…

Get week number from date in Excel

If you need to get the week number from the day from a date, you can use the WEEKNUM function. The date must be in a form that Excel recognizes as a valid date. Note: The WEEKNUM function takes two arguments, a date, and, optionally, an argument called return_type, which controls the scheme used to calculate the week number. Formula =WEEKNUM(date)…

Get work hours between dates in Excel

To calculate the total number of work hours between two dates, you can use a formula based on the NETWORKDAYS function, where “start” is the start date, “end” is the end date, “holidays” is a range that includes dates, and “hours” is the number of work hours in a workday. Formula =NETWORKDAYS(start,end,holidays)*hours Explanation In the example shown, the formula in…