How to calculate the deadline in excel? Calculate the number of days and time between two dates Calculation
First, calculate the number of days between two dates.
Recommended: "Excel Tutorial"
In excel, you can directly subtract two dates to get the number of days between the two dates, as shown below:
Calculate the number of days between two dates, you can also use the hidden function DATEDIF function to complete, the formula is as follows:
=DATEDIF(A2,B2,"d" )
DATEDIF() function knowledge points introduction:
The syntax of this function is like this: =DATEDIF (start date, end date, third parameter) , the third parameter can have several situations, and can respectively return the number of days, months and years of the interval.
Let’s take a look at how to calculate time.
First of all, the simplest is to directly subtract the two times to get the time difference. But note that the cells storing the results must be set to time format.
The above example is for a time that does not exceed 1 day. If it exceeds 1 day and is directly subtracted using the above method, what will be the result?
The above example more often appears in the time calculation of the attendance sheet. Since the two dates may span 2 days or more, the default display result is incorrect and needs to be set. How to format cells to display normal time differences. As shown in the figure below, set the cell format to "[h]:mm:ss", where h plus square brackets can fully display the difference in hours. Without square brackets, only the difference in hours after deducting days can be displayed.
Tips:
When subtracting the time and date mentioned above, you need to subtract the smaller one from the larger one, otherwise unexpected results will occur. mistake.
The above is the detailed content of How to calculate deadline in excel. For more information, please follow other related articles on the PHP Chinese website!