# Rollup hours

**URL:** <https://community.glideapps.com/t/rollup-hours/49888>\
**Category:** Ask for Help\
**Created:** [September 22, 2022, 6:24am UTC](https://community.glideapps.com/t/rollup-hours/49888 "2022-09-22T06:24:34Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![ndiapro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ndiapro/32/58235_2.png) [@ndiapro](https://community.glideapps.com/u/ndiapro)\
**Post date:** [September 22, 2022, 6:24am UTC](https://community.glideapps.com/t/rollup-hours/49888/1 "2022-09-22T06:24:34Z")

</div>

Hello there! Could anybody help me to rollup hours total for each participant. I tried to rollup but only two option are proposed (count and count unique).

How can i rollup hours?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 22, 2022, 6:35am UTC](https://community.glideapps.com/t/rollup-hours/49888/2 "2022-09-22T06:35:48Z")

</div>

If you only get count/count unique, that means the column you are trying to rollup is not recognised as a number type.

Can I see a screen shot of that column (including the column header) from the Glide Data Editor please?

---

<div class="post-metadata">

**Author:** ![ndiapro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ndiapro/32/58235_2.png) [@ndiapro](https://community.glideapps.com/u/ndiapro)\
**Post date:** [September 22, 2022, 7:11am UTC](https://community.glideapps.com/t/rollup-hours/49888/3 "2022-09-22T07:11:43Z")

</div>

![CAPTUREEcran](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/1/01ad507a8420ffb1129c07376e9db968f7ca3175.png)  
Here is the screenshot. Thank you for your assistance

---

<div class="post-metadata">

**Author:** ![ndiapro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ndiapro/32/58235_2.png) [@ndiapro](https://community.glideapps.com/u/ndiapro)\
**Post date:** [September 22, 2022, 7:16am UTC](https://community.glideapps.com/t/rollup-hours/49888/4 "2022-09-22T07:16:37Z")

</div>

S1HD = Session 1 : Start’s hour  
S1HF = Session 1 : end’s hour  
S2HD = Session 2 : Start’s hour  
S2HF = Session 2 : end’s hour  
Cumul/Jr = Addition of the two session in a day = total duration of the task

I would like to rollup the column “cumul/Jr” in order to get the time spent by each name

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 22, 2022, 7:19am UTC](https://community.glideapps.com/t/rollup-hours/49888/5 "2022-09-22T07:19:53Z")

</div>

Okay, that column is returning a duration, and you can’t roll up a duration.  
You would need to convert it to either days/hours/minutes/seconds first (whichever makes sense), then rollup that value, and then convert it back (if required).

Can you show me your current formula in the Cumul/Jr column?

---

<div class="post-metadata">

**Author:** ![ndiapro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ndiapro/32/58235_2.png) [@ndiapro](https://community.glideapps.com/u/ndiapro)\
**Post date:** [September 22, 2022, 7:22am UTC](https://community.glideapps.com/t/rollup-hours/49888/6 "2022-09-22T07:22:04Z")

</div>

![CAPTUREEcran](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/0/b0e2c7f9ba08779c299c79f0c91a7a177a3a90d2.png)

---

<div class="post-metadata">

**Author:** ![ndiapro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ndiapro/32/58235_2.png) [@ndiapro](https://community.glideapps.com/u/ndiapro)\
**Post date:** [September 22, 2022, 7:24am UTC](https://community.glideapps.com/t/rollup-hours/49888/7 "2022-09-22T07:24:23Z")

</div>

![CAPTUREEcran](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/8/789099b838206a70968e4f5a9e1484ff9045d308.png)

---

<div class="post-metadata">

**Author:** ![ndiapro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ndiapro/32/58235_2.png) [@ndiapro](https://community.glideapps.com/u/ndiapro)\
**Post date:** [September 22, 2022, 7:25am UTC](https://community.glideapps.com/t/rollup-hours/49888/8 "2022-09-22T07:25:45Z")

</div>

How to convert it to days/hours/minutes/seconds?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 22, 2022, 7:27am UTC](https://community.glideapps.com/t/rollup-hours/49888/9 "2022-09-22T07:27:00Z")

</div>

That’s why I asked to see your formula 😉

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 22, 2022, 7:47am UTC](https://community.glideapps.com/t/rollup-hours/49888/10 "2022-09-22T07:47:38Z")

</div>

> [@ndiapro](#):
>
> S1HD = Session 1 : Start’s hour  
> S1HF = Session 1 : end’s hour  
> S2HD = Session 2 : Start’s hour  
> S2HF = Session 2 : end’s hour

Okay, to get your total duration in hours, use the following:

```auto
Trunc((S1HF - S1HD)*24)
+ Trunc((S2HF - S2HD)*24)

```

This will give you a result in _decimal_ hours, which you should be able to use for a Rollup-\>Sum

What format is required for the result of the rollup?

---

<div class="post-metadata">

**Author:** ![ndiapro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ndiapro/32/58235_2.png) [@ndiapro](https://community.glideapps.com/u/ndiapro)\
**Post date:** [September 22, 2022, 7:51am UTC](https://community.glideapps.com/t/rollup-hours/49888/11 "2022-09-22T07:51:59Z")

</div>

The result should be the total of hours spent (10:30:00 for exemple witch means 10 hours et 30 mn)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 22, 2022, 7:58am UTC](https://community.glideapps.com/t/rollup-hours/49888/12 "2022-09-22T07:58:11Z")

</div>

Do you care about the seconds, or would hh:mm be good enough?

---

<div class="post-metadata">

**Author:** ![ndiapro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ndiapro/32/58235_2.png) [@ndiapro](https://community.glideapps.com/u/ndiapro)\
**Post date:** [September 22, 2022, 8:04am UTC](https://community.glideapps.com/t/rollup-hours/49888/13 "2022-09-22T08:04:01Z")

</div>

hh:mm is good enouch

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 22, 2022, 8:18am UTC](https://community.glideapps.com/t/rollup-hours/49888/14 "2022-09-22T08:18:27Z")

</div>

Okay…

First of all, change that earlier formula that I gave you to the following:

```auto
Trunc((S1HF - S1HD)*1440)
+ Trunc((S2HF -S2HD)*1440)

```

 ![Screen Shot 2022-09-22 at 4.09.49 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/3/03e895d6a5934814d730191b9f7ec0533d0c9296.png)

This will give you a result for each row in minutes instead of hours.

Then do your rollup-\>sum on that column.

To get that back into hh:mm, you need 4 additional columns…

- First one is to extract the number of hours from the rollup result:

```auto
Trunc(Total/60)

```

 ![Screen Shot 2022-09-22 at 4.13.00 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/9/690d311f7a9e37d332dcdfe2cbcd19f9ebd3ead7.png)

- Next one is to extract the number of minutes:

```auto
Mod(Total,60)

```

 ![Screen Shot 2022-09-22 at 4.13.54 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/a/f/af099751152e7a015669a9d5d7fac9c2dd8ca7bc.png)

- Then an if-the-else column to determine if the minutes should be zero-padded:

 ![Screen Shot 2022-09-22 at 4.15.06 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/5/6506d1d069129432a32c12d8d97e17d2cd2e3b0e.png)

- And then finally a template column to join all the bits together:

```auto
{hh}:{pad}{mm}:00

```

 ![Screen Shot 2022-09-22 at 4.15.19 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/7/57747a11f81ebc173d1ccd703cd1c3032ee5e0ce.png)

I realise that’s all quite convoluted for something you’d think should be pretty simple.  
To be honest, this is a case where I would probably replace all of that with a single JavaScript column.  
But I just wanted to show you how to do it without using code.

---

<div class="post-metadata">

**Author:** ![ndiapro](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/ndiapro/32/58235_2.png) [@ndiapro](https://community.glideapps.com/u/ndiapro)\
**Post date:** [September 22, 2022, 8:35am UTC](https://community.glideapps.com/t/rollup-hours/49888/15 "2022-09-22T08:35:16Z")

</div>

> [@Darren\_Murphy](#):
>
> `{hh}:{pad}{mm}:00`

VERY VERY GREAT. THANKS A LOT DARREN

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [September 23, 2022, 8:36am UTC](https://community.glideapps.com/t/rollup-hours/49888/16 "2022-09-23T08:36:02Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
