The DATEDIF function is mainly used to calculate the number of days, months or years between two dates. The value returned is the number of years, months, and days between two dates.
Syntax: DATEDIF (Start_Date,End_Date,Unit)
Start_Date: is a date, which represents the first date or starting date in the time period;
End_Date: is a date, which represents the last date or end date within the time period;
Unit: is the return type of the required information.
Information type parameters:
The DATEDIF function is often used in offices and is mainly used to calculate the number of days, months or years between two dates.
The following will teach you the techniques and precautions for using this function:
First select cell (C2), select Insert Function, find DATEDIF, and click OK.
Fill in the start date (A2) and the end date (B2). There are three options for "comparison unit": Y represents the year, M represents the month, and D represents the day. It should be noted that there are three requirements before and after the value of the "comparison unit". Enter double quotes for English characters, otherwise a #NAME? error value will appear. Enter D here to calculate the interval number of days, click OK, and you will get the interval number of days 2042;
In addition to the above basic usage, there are the following three situations: First, calculate the number of date intervals that ignore the year. You can fill in the "Comparison Unit" and select "YD" to indicate that only month and day intervals are calculated. Second, ignore the year and month and calculate the number of days between two dates, using "MD" as the unit. In the same way, if you want to ignore the year and calculate the number of months between intervals, set the unit to "YM".
Have you mastered this skill?
评论列表(196条)
测试