DATEDIF function - The function calculates the number of days, months, years between 2 dates in Excel
The following article introduces you to the DATEDIF function - one of the functions in the date and time group function is very popular in Excel.
Description: The function calculates the number of days, months and years between two dates in Excel. Functions are useful in formulas for calculating age numbers.
Syntax: DATEDIF (start_date, end_date, unit)
Inside:
- start_date: The first day or representing the first period of time you want to calculate, the date can be entered as text string or as a serial number.
- end_date: The last day or represent the last period you want to count.
- unit: The type of information you want to return, including the following values:
+ unit = 'Y' -> Returns the number of years in the period.
+ unit = 'M' -> Returns the number of months in the time period.
+ unit = 'D' -> Returns the number of days in the period.
+ unit = 'MD' -> Returns the difference between start_date and end_date dates , regardless of the month and year.
+ unit = 'YM' -> Returns the difference between months in start_date and end_date , regardless of the day and year.
+ unit = 'YD' -> Returns the difference between dates in start_date and end_date , regardless of the year.
Attention:
- Date values are stored as serial numbers in Excel.
- DATEDIF function is very useful in calculating age.
For example:
1. Calculate time intervals based on criteria according to the table described below with Unit options.
- In the cell to calculate, enter the formula: DATEDIF (E7, F7, G7).
- Press Enter -> return value is:
- Similarly copying the formula for the remaining values results:
2. Use the DATEDIF function to calculate the age of the following employees:
- In the cell to calculate, enter the formula: = DATEDIF (G7, NOW (), "Y").
- Press Enter -> the employee's age is:
- Similarly copying the formula for the remaining values results:
Above are instructions and some specific examples when using the DATEDIF function .
Good luck!
You should read it
- The DAYS function - The function returns the number of days between 2 dates in Excel
- DATEDIF () function (calculate the total number of years, total months or total days from two given periods) in Excel
- How to subtract dates, months, and years in Excel - Calculate the distance between two dates in Excel
- NETWORKDAYS function - The function returns the number of whole working days between 2 dates in Excel
- NETWORKDAYS.INTL function - The function returns the number of whole working days between 2 dates, specifying weekends in Excel
- Coupdays function - Calculates the number of days in a coupon period and contains the settlement date in Excel
- Wings calculates the number of days, the difference between two dates in Excel
- YEARFRAC function - The function returns the fifth calculated by the number of whole days between two specific dates in Excel
May be interested
- Suggestions on how to fix the error of not being able to use the DATEDIF function in Exceldatedif is a function used to calculate time differences. if you cannot use the datedif function in excel, please refer to some ways to fix it
- DAYS function, how to use the function to calculate the number of days between two time points in Excelthe days function in excel returns the results between two different timelines.
- 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.
- 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.
- 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
- NPER function - The function calculates the period number of an investment in Excelcalculating interest rates for securities are usually calculated by period. so if you are a stock player, please know this calculation offline to be able to actively calculate the interest received. the following article shows how to use the nper function to calculate the number of periods for an investment.
- Calculation of age in Excelto calculate age in excel, we can use these two functions as year or datedif functions.
- How to calculate the number of days in Excel - Functions, formulas for calculating the number of days in Excelhow to calculate the number of days in excel - functions, formulas for calculating the number of days in excel. in the process of processing data in excel, you will certainly encounter many cases that need to calculate the number of days such as the number of days guests stay, the number of days to perform work ... it will be difficult if the
- EOMONTH function - The function returns the last day in the month before or after 1 day of a specified number of months in Exceleomonth function: the function performs calculations and returns the last day in the month before or after 1 day a certain number of months. syntax: eomonth (start_date, months)
- FREQUENCY function - Function that calculates and returns the frequency of occurrences of values in a range in Excelfrequency function: function that calculates and returns the frequency of occurrences of values within a certain range and returns a vertical number array. syntax: frequency (data_array, bins_array)