-
Function and parameter description
函数:DATEDIF(start_date,end_date,unit)
Start_date: is a date that represents the first date or start date in the time period.
End_date: is a date that represents the last date or end date in the time period.
Unit: is the return type of the required information.
The meaning of Unit taking different values:
"Y" - the whole number of years in the time period.
"M" - the number of whole months in the time period.
"D" - The number of days in the period.
"YM" - the difference in months between start_date and end_date. Day and year in dates are ignored.
"YD" - the difference in days between start_date and end_date. Years in dates are ignored.
"MD" - the difference in days between start_date and end_date. Ignore the month and year in the date.
-
for example.
Start Date: 2012/12/21
End date: 2014/2/26
Enter the formula "=DATEDIF(A2,B2,"Y")" in cell C2, being careful not to include the outermost double quotes;
Enter the formula "=DATEDIF(A2,B2,"YM")" in cell D2;
Enter the formula "=DATEDIF(A2,B2,"MD")" in cell E2;
Enter the formula "=DATEDIF(A2,B2,"D")" in cell F2.
---------2 Dynamically take the value of a cell -------------
The method of how to get the value of the cell according to the dynamic row number and column number in EXCEL is as follows: 1. ADDRESS(1,2), take the first row of the table and the value cell address reference of the second column, the function value is $A$2; 2. INDIRECT($A$2), get the value of cell A2; 3. Enter =INDIRECT(ADDRESS(3, the calculated value) in A1)
--------3 Integer function---------
=INT(A1) 向下取整 =ROUND(A1,0) 四舍五入取整 =ROUNDUP(A1,0) 向上取整 =ROUNDDOWN(A1,0)向下取整 还有其它可以取整的函数