# Is it possible to calculate the date difference from the data in a Lookup column?

**URL:** <https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430>\
**Category:** Ask for Help\
**Created:** [June 27, 2024, 4:34pm UTC](https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430 "2024-06-27T16:34:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlydefilippi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/charlydefilippi/32/66493_2.png) [@charlydefilippi](https://community.glideapps.com/u/charlydefilippi)\
**Post date:** [June 27, 2024, 4:34pm UTC](https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430/1 "2024-06-27T16:34:11Z")

</div>

I have a lookup column that brings me dates and other lookup column that brings me numbers which are weight records from cows, I can calculate the variation on the weights using a Rollup column that calculates the range from the lookup with the weight records but I don’t know how to calculate the date difference from the lookup column that have all the dates in which the weights of the cows were measured. I need this to then calculate the weight gains by day

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [June 27, 2024, 8:27pm UTC](https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430/2 "2024-06-27T20:27:23Z")

</div>

> [@charlydefilippi](#):
>
> I can calculate the variation on the weights using a Rollup column that calculates the range from the lookup

You don’t need a Lookup column in between. The Rollup can directly use the relation or table that the lookup would be using.

> [@charlydefilippi](#):
>
> I don’t know how to calculate the date difference from the lookup column that have all the dates

Can you use a Rollup Min and Rollup Max and then calculate the difference using a math column?

---

<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:** [June 27, 2024, 11:42pm UTC](https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430/3 "2024-06-27T23:42:36Z")

</div>

> [@charlydefilippi](#):
>
> I don’t know how to calculate the date difference from the lookup column that have all the dates in which the weights of the cows were measured

For this, do you mean the date difference between the dates associated with the highest and lowest weights?

---

<div class="post-metadata">

**Author:** ![charlydefilippi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/charlydefilippi/32/66493_2.png) [@charlydefilippi](https://community.glideapps.com/u/charlydefilippi)\
**Post date:** [June 28, 2024, 11:47am UTC](https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430/4 "2024-06-28T11:47:39Z")

</div>

It seems that when the values are dates the rollup only lets you count and count unique

---

<div class="post-metadata">

**Author:** ![charlydefilippi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/charlydefilippi/32/66493_2.png) [@charlydefilippi](https://community.glideapps.com/u/charlydefilippi)\
**Post date:** [June 28, 2024, 11:48am UTC](https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430/5 "2024-06-28T11:48:02Z")

</div>

exactly

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [June 28, 2024, 1:56pm UTC](https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430/6 "2024-06-28T13:56:26Z")

</div>

Are you sure? Rollup should give you Earliest and Latest options when dates are involved.

 ![Screenshot_20240628-085150~2](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/0/3054bc034b7e05c2e463b3a0cf9872902e610bde.png)

---

<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:** [June 28, 2024, 2:19pm UTC](https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430/7 "2024-06-28T14:19:27Z")

</div>

If you’re not seeing Earliest and Latest as rollup options, that suggests that your source column is not actually a date/time type. Is it?

---

<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:** [June 29, 2024, 12:37am UTC](https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430/8 "2024-06-29T00:37:26Z")

</div>

Can you show us a sample of your data through screenshots?

---

<div class="post-metadata">

**Author:** ![charlydefilippi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/charlydefilippi/32/66493_2.png) [@charlydefilippi](https://community.glideapps.com/u/charlydefilippi)\
**Post date:** [July 1, 2024, 9:13pm UTC](https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430/9 "2024-07-01T21:13:22Z")

</div>

thanks @ThinhDinh @Darren_Murphy and @Jeff_Hager for the suggestions. Indeed the column of dates wasn’t on dates format but the problem comes from a script on the google sheets that its not processing well the dates and then the sheet and glide doesn’t recognize them as dates, i will fix that and then make a column for the earliest date, the last one and for the time difference between them so then I can calculate the daily weight gain.  
thanks!

---

<div class="post-metadata">

**Author:** ![charlydefilippi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/charlydefilippi/32/66493_2.png) [@charlydefilippi](https://community.glideapps.com/u/charlydefilippi)\
**Post date:** [July 2, 2024, 12:49pm UTC](https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430/10 "2024-07-02T12:49:59Z")

</div>

![check](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/6/e687f98c3d25a26f7e0489b22c166ca254685c3b.jpeg)  
The problem solved by adjusting the format the script gave me of the dates.

---

<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:** [July 9, 2024, 12:50pm UTC](https://community.glideapps.com/t/is-it-possible-to-calculate-the-date-difference-from-the-data-in-a-lookup-column/74430/11 "2024-07-09T12:50:00Z")

</div>

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