DATEDIF () function (calculate the total number of years, total months or total days from two given periods) in Excel
Processing and calculating data with data is time (type date) very difficult because you can not use normal calculations. But the DATEDIF () function will help you do this, the function will help you calculate the data of the format of time in Excel.
The article describes the syntax and usage of the DATEDIF () function in Excel.
Description
The DATEDIF () function helps you calculate the total number of years, the total number of months, or the total number of days from two given periods.
You can use this function from Excel 2003 and newer versions, the DATEDIF () function is not in the list of Excel functions, so when you enter = DATEDIF, the function is not displayed in the Excel function list.
Syntax
= DATEDIF (start_day, end_day, unit)
Inside:
- start_day: start date to calculate.
- end_day: end date, end_day needs to be bigger than start_day.
- unit: type of result returned by the calculation, to be written in quotation marks.
Below is a list of unit options.
y: the number of years the difference between start_day and end_day.
m: number of months difference between start_day and end_day.
d: number of days difference between start_day and end_day.
md: the number of days difference between start_day and end_day, regardless of the number of years and months.
ym: the number of months difference between start_day and end_day, regardless of the number of years and days.
yd: number of days difference between start_day and end_day, regardless of the number of years.
For example
Example 1: Use the DATEDIF function to calculate the age of employees.
Apply the function to the last employee: = DATEDIF (D11, NOW (), "y")
- D11: is the start date (year of birth).
- NOW () is a function to get the current date of the computer.
- y to determine the return value is the difference between the current year and the year of birth.
The following results:
Example 2: For start_day is February 1, 2013 and end_day is December 28, 2014, applying all unit options will result in the following:
So you know how to use the DATEDIF () function in Excel. With the support of the DATEDIF () function, the processing of date data calculations will be a lot easier. Good luck!
You should read it
- How to calculate the number of days in Excel
- How to calculate the total value based on multiple conditions in Excel
- SUM function in Excel: How to use SUM to calculate totals in Excel - SUM function in Excel
- How to quickly see the total number of pages of Word files?
- Download 360 Total Security 10.8.0.1269: Free antivirus software for Windows
- How to subtract dates, months, and years in Excel - Calculate the distance between two dates in Excel
- DAYS function, how to use the function to calculate the number of days between two time points in Excel
- Practical exercise on computer rental list in Excel
May be interested
- Calculation of age from date of birth in Excelthe following article will guide you how to calculate the age from date of birth in excel so you can calculate the exact number of standard age in years, months and days. in the process of calculating age based on date of birth, the following cases occur: - case 1: calculates the usual age
- How to use DSUM function in Excelthe dsum function on excel is used to calculate the conditional sum in a field, or column in the data list.
- 3 ways to calculate totals in Excelto calculate totals on excel, users can use them in three different ways, based on spreadsheets, autosum functions or sum functions with large data areas.
- How to use the SUM function to calculate totals in Excelsum is a popular and very useful excel function, and is also a basic arithmetic function. as its name suggests, the sum function is used to calculate totals in excel. and the parameters can be single parameters or ranges of cells. in this article, tipsmake.com will guide you to use the sum function to calculate the sum in excel, the common errors when calculating sum by sum and how to fix it.
- How to calculate the number of days between two time points extremely quickly using Excelcalculating the number of days between two dates in excel is not difficult. here is a super fast way to calculate the number of days between two dates in excel that you cannot ignore.
- DAYS360 function - The function finds the number of days between two dates based on a 360-day year in Excelthe days360 function is used to calculate days based on a year of only 360 days. the function is usually used to calculate payments if your accounting system is based on a 360-day year.
- The DAYS function - The function returns the number of days between 2 dates in Exceldays function: the function returns the number of days between 2 dates, the support function from excel 2013 onwards. syntax: days (end_date, start_date)
- ABS function (absolute value calculation) in Excelwhen you need to calculate absolute values for numbers in excel spreadsheets, you can use the abs function to calculate. the abs function helps you calculate the absolute value of a number, an expression or reference containing a number.
- Wings calculates the number of days, the difference between two dates in Excelto calculate the number of days difference between 2 dates in excel that support functions, you can in a snap to calculate the number of days between any two time points.
- How to use the kernel function (PRODUCT function) in Excelin excel, product helps users to calculate product values, multiply arguments together, and return their results correctly.