Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a Google Spreadsheet that looks roughly like this:

 Date        | Start time  | End time    | Minutes
 1/11/2012   | 11:39       | 12:41       | ?!
             |             |             | 

Right now if I fill in the number of minutes between the two times of day by hand. Is there a straight-forward way to calculate a time delta and have the spreadsheet do it for me?

share|improve this question
Hi Stefano, perhaps you can take some time and evaluate the answers given. – Jacob Jan Tuinstra Aug 2 '13 at 18:58
@jacob As far as I can work out, my answer still works. I'll try to clarify and improve it a bit. – Stefano Palazzo Aug 5 '13 at 6:49
up vote 21 down vote accepted

Google has added a new number format called Duration. Set your start and end fields to Format -> Number -> Time and your calculation field to Format -> Number -> Duration

Once you have done that you can subtract the fields to get the difference as noted by Stefano Palazzo in his answer.

share|improve this answer

Yes, If your time fields are properly formatted (click Format → Number → Time) you can just add and subtract times:



21:58:00 - 20:44:00 = 1:14:00

This will give you the time delta as HH:MM:SS. And if you want to calculate the number of minutes, you can use the Hour(), Minute() and Second() functions on that field:

=(Hour(D2) * 60) + Minute(D2) + (Second(D2) / 60)

Of course, if there are leap-seconds, time zone changes, or if an event takes longer than 24 hours, you will still have to adjust the results manually.

A warning

If one event stretches past midnight, say from 23:50 to 00:10, this will show up as a negative time!

In oder to have these events handled 'correctly', you can either put "24:10" or split the event into two.

A Better way

Even though it's a bit harder to input data, the most reliable way to do this is to mark the beinning and end field as "Date Time" and the delta field as "Hours", which will look like this:

Beginning          End                  Delta
8/1/2013 0:00:00   8/2/2013 12:30:00    36:30:00
share|improve this answer
This doesn't appear to work anymore. I think you need to choose Format > Number > Hours (vs. time). I get a very odd decimal number when I try to subtract simple hourly difference. – Elijah Lynn Jul 5 '13 at 17:27
@ElijahLynn this odd number are the number of days. Multiplying times 24 and 60 will give you the number of minutes, – Jacob Jan Tuinstra Jul 21 '13 at 12:36

I've done a lot of experimentation. This is the easiest way to calculate a time delta in Google Spreadsheets. Format the cell containing the formula like this:

Formula cell formatting

Format > Number > More Formats > More date and time formats, delete "second" and :. Then, format the End time and Start time cells like this: h:mm am/pm.

Input time cell formatting

Use the formula =abs(end time - start time). This gives you an absolute value, so there won't be negative time values.

share|improve this answer

For a more robust solution, we uses a custom Function.

1. Adding the custom function

Using the Script Editor (follow instruction in https://developers.google.com/apps-script/execution_custom_functions) - writes:

function toEpoch (indate) {
  return indate.getTime();

2. Add formular

Then in the cell, writes:

=(toEpoch(C2)-toEpoch(B2)) / 60*1000

Which convert the difference in Epoch milliseconds into minutes.

share|improve this answer

If you add the following formula in D2, then the minutes are calculated automatically:




The difference between the times, as per decimal format, is expressed in days. Therefore multiplying times 24 time 60 will yield minutes


There is one prerequisite: column D needs to be formated as 'normal'.


See example file I created: Delta Time

share|improve this answer

So much simpler: look at this B2: 23:00 C2: 1:37 D2: =C2-B2+(B2>C2)

Why it works, time is a fraction of a day, the comparison B2>C2 returns True (1) or False (0), if true 1 day (24 hours) is added. http://www.excelforum.com/excel-general/471757-calculating-time-difference-over-midnight.html

share|improve this answer

I agree that the time delta is expressed in days so to get back to say minutes you should multiply the difference by 1440, which is 24 x 60.

I had this problem today and thought I would mention the other simple method of getting the current time in a Google Docs spreadsheet is to enter <CONTROL>: in the cell. You can use this for both the Start and End Times cells.

If you need to enter the current date in a cell, then this is achieved by <CONTROL>;


share|improve this answer
Thanks for sharing, but it isn't an answer to the question. Read more tour that in our help center. Welcome to Web Applications !! – Jacob Jan Tuinstra Nov 6 '13 at 6:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.