In this article we will learn about how to Calculate Number of Minutes between Dates and Time in Microsoft Excel 2010.
To calculate the number of minutes between two dates and times follow the below given steps.
We have two dates with time, 1st date in cell A1 and 2nd date in cellA2.
- Select the Cell B1
- Enter the formula = (A1-A2)*1440. In the formula you have to minus the 1st date from the to 2nd date. That is, you have to minus the small date from the large date. To convert the time into minutes you have to multiply by 1440. (24 hours * 60 minutes = 1440).
- Press enter on the keyboard.
- The function will return 324360 minutes.
This value returned is the difference between two dates in terms of the number of minutes between the two. This number can then be used for other calculations.
Calculate time difference between Date and Today
To calculate number of days, months or years between two dates, we will use Datedif Function.
Column A contains Dates & in column B we want to see the Result.
See example 1 below -
Datedif function is used to calculate the interval between two dates in days, months or years.
Syntax =DATEDIF(start_date, end_date, interval_unit)
The Datedif function has 3 arguments:
- start_date: the starting date
- end_date: the last date
- interval_unit: tells the function to find the number of days (“D”), complete months (“M”), complete years (“Y”), count of days after the current year (“YD”), count of months after the current year (“YM”), count of days after the current month (“MD”) between the two dates.
In example 1, considering that the date the file was created was 9th July 2014, the number of days between 9th June 2014 and the file created date is 30 days which is returned in cell B5 above. Similarly, the other values are calculated. Instead of entering the current date / file created date, today() is entered which will keep changing as the date changes.
In the below screenshot, we have Start Date, End Date & Interval Unit in column A, B & C respectively. The result will be returned in column D.
- In cell D17, the Datedif function is calculating the result based on the Interval Unit provided in C17. Hence, we get the number of days as 554.
- In cell D18, we get 18 as there is a difference of 18 months in between both these dates.
- In cell D19, we get 1 as the result as there is a difference of 1 year between the year of the start date and the year of the end date.
- In cell D20, we get 189 as the result, as we need to exclude the first year and count the number of days from 1-Jan-14 to 9-Jul-14 which is 189.
- Similarly in cell D21, we get 8 as the result, as it is the difference between 9-Jul-2014 and 1-Jul-2014.
- In cell D22, we get 6 as the result. It counts the number of months after the current year which is 6 months.
- In cell D23,the #NUM! error appears as the start_date is greater than the end_date. It could also occur if the interval_unit has an invalid value.