# Help with time duration equation between two dates/times

**URL:** https://community.glideapps.com/t/help-with-time-duration-equation-between-two-dates-times/12821
**Category:** Ask for Help
**Created:** [July 20, 2020, 1:53pm UTC](https://community.glideapps.com/t/help-with-time-duration-equation-between-two-dates-times/12821 "2020-07-20T13:53:00Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Steven\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/steven_shields/32/2630_2.png) [@Steven\_Shields](https://community.glideapps.com/u/Steven_Shields)
#### Post date: [July 20, 2020, 1:53pm UTC](https://community.glideapps.com/t/help-with-time-duration-equation-between-two-dates-times/12821/1 "2020-07-20T13:53:00Z")

</div>

I have two date/time columns and need an equation to extract the duration in hours/minutes. I’d do it on the Google Sheet but new submissions create a new row so any formula on the sheet does not apply to new rows. [Screen Shot 2020-07-20 at 9.48.07 AM|300x209](https://community.glideapps.com/uploads/short-url/9sTJ7ZnYlI1WEkktCdwiKTPeXmV.png)

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [July 20, 2020, 2:21pm UTC](https://community.glideapps.com/t/help-with-time-duration-equation-between-two-dates-times/12821/2 "2020-07-20T14:21:04Z")

</div>

You can use this.

> [@Tutorial: Arrayformula in Google Sheets, good practices & how to overcome Arrayformula restrictions with scripts](https://community.glideapps.com/t/tutorial-arrayformula-in-google-sheets-good-practices-how-to-overcome-arrayformula-restrictions-with-scripts/9727):
>
> Hi, Today I will show you the script that can make copying formulas down work, when it does not work with arrayformula. But first, let’s have some introductions about arrayformula, for those who has not used this before in Google Sheets, some equivalents in Glide and some good practices while using it. I hope it can help you in building your Glide apps as well as applying it in your normal day job. 
> 
> > **1/ Definition**
> >
> > Arrayformula is defined as “a range, mathematical expression using one cell range …

---

<div class="post-metadata">

### Author: ![Coupons\_Deal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/coupons_deal/32/9734_2.png) [@Coupons\_Deal](https://community.glideapps.com/u/Coupons_Deal)
#### Post date: [July 20, 2020, 2:21pm UTC](https://community.glideapps.com/t/help-with-time-duration-equation-between-two-dates-times/12821/3 "2020-07-20T14:21:34Z")

</div>

I was doing the same today. Check below to calculate hours and minute components

=ARRAYFORMULA(HOUR(D2:D - B2:B))

=ARRAYFORMULA(MINUTE(D2:D - B2:B))

---

<div class="post-metadata">

### Author: ![Coupons\_Deal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/coupons_deal/32/9734_2.png) [@Coupons\_Deal](https://community.glideapps.com/u/Coupons_Deal)
#### Post date: [July 20, 2020, 2:26pm UTC](https://community.glideapps.com/t/help-with-time-duration-equation-between-two-dates-times/12821/4 "2020-07-20T14:26:24Z")

</div>

Wowwww… Very Very Very Nice Post… I have just started holding up with GSheets and playing with formula. I am loving it and your post is just what i should be knowing… Cheers to you 👏 👏 🍻

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [July 20, 2020, 2:34pm UTC](https://community.glideapps.com/t/help-with-time-duration-equation-between-two-dates-times/12821/5 "2020-07-20T14:34:57Z")

</div>

After you’re familiar with that you can try these too, hope it helps 😄

> [@Tutorial - QUERY: "The most powerful function" in Google Sheets (part 1)](https://community.glideapps.com/t/tutorial-query-the-most-powerful-function-in-google-sheets-part-1/10432):
>
> This topic was inspired by our last community meetup, in which we talked about some formulas in Google Sheets and some people want to know more about QUERY, which was branded [“The most powerful function in Google Sheets”](https://www.benlcollins.com/spreadsheets/google-sheets-query-sql/) by famous GSheets teacher Ben Collins. So, what is QUERY, and why is it so powerful. Here’s a writeup on it, which hopefully would help many of you here in this community. Trust me, it would change so much how many of you “clean” your data in the future from raw data, in a very…

> [@Tutorial - QUERY: “The most powerful function” in Google Sheets (part 2)](https://community.glideapps.com/t/tutorial-query-the-most-powerful-function-in-google-sheets-part-2/10849):
>
> If you have not read part 1, below is the direct link so you can have a read at what QUERY is, and how it can help your case, whether it be building Glide apps or make your normal day work easier. 
> 
> > **6/Dynamically sort your data using ORDER BY**
> >
> > An ORDER BY claused can be used to dynamically sort your data after being queried, and you can change the column that is used to sort with just a letter. By default, the ORDER BY sorts ascendingly, and it can grab the data type in the column automatically.…

---

<div class="post-metadata">

### Author: ![Coupons\_Deal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/coupons_deal/32/9734_2.png) [@Coupons\_Deal](https://community.glideapps.com/u/Coupons_Deal)
#### Post date: [July 20, 2020, 3:37pm UTC](https://community.glideapps.com/t/help-with-time-duration-equation-between-two-dates-times/12821/6 "2020-07-20T15:37:11Z")

</div>

😍 🍸

---

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [July 20, 2020, 6:13pm UTC](https://community.glideapps.com/t/help-with-time-duration-equation-between-two-dates-times/12821/7 "2020-07-20T18:13:13Z")

</div>

I would suggest to use “CopyDown” add on in Google sheet.

---

<div class="post-metadata">

### Author: ![Tim\_Sullivan](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/tim_sullivan/32/3461_2.png) [@Tim\_Sullivan](https://community.glideapps.com/u/Tim_Sullivan)
#### Post date: [July 20, 2020, 10:13pm UTC](https://community.glideapps.com/t/help-with-time-duration-equation-between-two-dates-times/12821/8 "2020-07-20T22:13:30Z")

</div>

Take a look at this post, it may get your creative juices flowing.

> [@Time Sheet App](https://community.glideapps.com/t/time-sheet-app/5333/3):
>
> So I put a small project together that tracks snow plow driver’s times. The Supervisor inputs time in & time out, using the automatic date/time stamp as the “times”. To get the duration, I subtract the start timestamp from the end timestamp - [image] The key to getting a good time elapsed or time worked is to format the final result as “DURATION” in google sheets. Hope this helps you out.

---

<div class="post-metadata">

### Author: ![Steven\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/steven_shields/32/2630_2.png) [@Steven\_Shields](https://community.glideapps.com/u/Steven_Shields)
#### Post date: [July 21, 2020, 10:01pm UTC](https://community.glideapps.com/t/help-with-time-duration-equation-between-two-dates-times/12821/9 "2020-07-21T22:01:56Z")

</div>

Thank you! Works great. Seems to be an easy solution to all my issues.

S

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [July 21, 2020, 10:52pm UTC](https://community.glideapps.com/t/help-with-time-duration-equation-between-two-dates-times/12821/10 "2020-07-21T22:52:11Z")

</div>

My pleasure to help, Steven.
