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\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:
![image.png image.png](https://font2020.oss-cn-beijing.aliyuncs.com/wps/images/37c368427131248aaf002904224fe9dc.png)
DATEDIF function in the office It is often used in , 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:
![图文对齐图.png 图文对齐图.png](https://font2020.oss-cn-beijing.aliyuncs.com/wps/images/e1ea7da86ff61befb1c583b6784f105d.png)
■ First select the cell (C2), select Insert Function, find DATEDIF, and click OK.
![GIF1.gif GIF1.gif](https://font2020.oss-cn-beijing.aliyuncs.com/wps/images/d6a23d6fe899d73654daa49a46bd307c.gif)
■ Fill in the start date (A2) and the end date (B2). There are three options for "comparison unit": Y represents year, M Represents the month, D represents the day;
It should be noted that English character double quotes must be entered before and after the value of "Comparison Unit", otherwise a #NAME? error value will appear.
Enter D calculation interval hereThe number of days, click OK, you can get the interval number of days 2042;< /span>
![GIF2.gif GIF2.gif](https://font2020.oss-cn-beijing.aliyuncs.com/wps/images/d84b8bb129e58003f5f29a22266aa879.gif)
■ 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.
Similarly, if you want to ignore the year and calculate the number of months between intervals, set the unit to "YM".
![GIF3.gif GIF3.gif](https://font2020.oss-cn-beijing.aliyuncs.com/wps/images/951babc17277dc607cff2ac7c77c6c7d.gif)
Have you mastered this skill~
评论列表(196条)
测试