# Date in If Else Column Subtraction

**URL:** <https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117>\
**Category:** Ask for Help\
**Created:** [September 22, 2021, 3:25am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117 "2021-09-22T03:25:38Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![biha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/biha/32/84110_2.png) [@biha](https://community.glideapps.com/u/biha)\
**Post date:** [September 23, 2021, 6:37am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/21 "2021-09-23T06:37:40Z")

</div>

i’ve add two more math column for start and end date.  
But still the same.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/b/5b8543c76eb16b82918cfa6d89a301acec870b81.png)

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/a/fa9f22e69790be61b7ab7733a6ccc75205ca7482.png)

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/d/4da88c99df33deb86e20bcf4ce694d76030372a6.png)

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/0/40d40084a1e66c1fcfa943ec61887b492c55798e.png)

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [September 23, 2021, 6:39am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/22 "2021-09-23T06:39:13Z")

</div>

add plus 0 to math columns… you have just column in equations… that makes column a text

---

<div class="post-metadata">

**Author:** ![biha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/biha/32/84110_2.png) [@biha](https://community.glideapps.com/u/biha)\
**Post date:** [September 23, 2021, 6:39am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/23 "2021-09-23T06:39:18Z")

</div>

> [@Uzo](#):
>
> try to convert dates to numbers…

Which column, Uzo ?

---

<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 23, 2021, 6:40am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/24 "2021-09-23T06:40:38Z")

</div>

> [@biha](#):
>
> Darren,
> 
> Please help. Do you have any idea why I still cannot subtract that two things.  
> Today, I’ve tried using same conditions but in different sheet. But still cannot.  
> Do you have any idea why ?

Okay.  
Let me first restate your requirements in my own words, so that I can be sure that my understanding is correct.

You want to count the number of days between a given start and end date, with the following caveats:

- If the Start Date is earlier than Jan 1 of the current year, then use Jan 1 of the current year as the Start Date
- If the End Date is after the current date, then use the current date as the End Date

Is that correct?

---

<div class="post-metadata">

**Author:** ![biha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/biha/32/84110_2.png) [@biha](https://community.glideapps.com/u/biha)\
**Post date:** [September 23, 2021, 6:44am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/25 "2021-09-23T06:44:01Z")

</div>

> [@Darren\_Murphy](#):
>
> You want to count the number of days between a given start and end date, with the following caveats:
> 
> - If the Start Date is earlier than Jan 1 of the current year, then use Jan 1 of the current year as the Start Date
> - If the End Date is after the current date, then use the current date as the End Date
> 
> Is that correct?

Additional:

- If the End Date is before the 1 Jan current Year, then use the 1 Jan of current year as the End Date

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [September 23, 2021, 6:47am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/26 "2021-09-23T06:47:51Z")

</div>

why is that matter? date is a date… and is represented by a number… glide is plus 0.5 to google sheets … so you need to do conversion in GS

---

<div class="post-metadata">

**Author:** ![biha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/biha/32/84110_2.png) [@biha](https://community.glideapps.com/u/biha)\
**Post date:** [September 23, 2021, 6:49am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/27 "2021-09-23T06:49:52Z")

</div>

😩

When the math column adding with zero it is empty.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/f/3f761e1bfaa6700eb5bee2314613ee9f00733fc0.png)

---

<div class="post-metadata">

**Author:** ![biha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/biha/32/84110_2.png) [@biha](https://community.glideapps.com/u/biha)\
**Post date:** [September 23, 2021, 6:50am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/28 "2021-09-23T06:50:25Z")

</div>

But if you say so, why Darren did well ? In earlier post . Very smooth

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [September 23, 2021, 6:50am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/29 "2021-09-23T06:50:31Z")

</div>

that means your source is not a date format

---

<div class="post-metadata">

**Author:** ![biha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/biha/32/84110_2.png) [@biha](https://community.glideapps.com/u/biha)\
**Post date:** [September 23, 2021, 6:52am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/30 "2021-09-23T06:52:23Z")

</div>

No Uzo,  
All in date format.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/6/6603b5a955aac8adcebf022bf15782b82fe0ff8b.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/a/9a62578b6ee2660e831617487ab922a789bbe8d6.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/e/9e4533e7ecce513b73e7d2793d148ac20c55c1fb.png)

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [September 23, 2021, 6:52am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/31 "2021-09-23T06:52:42Z")

</div>

> **[Time & Duration Picker DEMO](https://time-duration-demo.glideapp.io/dl/ewAiAHQAIgA6ADAALAAiAHMAIgA6ACIAYwBsAGEAcwBzAC0AVABpAG0AZQAgAFAAaQBjAGsAZQByACIALAAiAHIAIgA6ACIAUgBGAHAAWQBiAEkAcgBHAFEATAA2AEwAYwB6ADcAMABiADAAQQBzAHcAQQAiACwAIgBuACIAOgAiAFQAaQBtAGUAIABQAGkAYwBrAGUAcgAgAEEATQAvAFAATQAiAH0A)**
>
> set only time in AM/PM or 24H format, or switch to duration

---

<div class="post-metadata">

**Author:** ![biha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/biha/32/84110_2.png) [@biha](https://community.glideapps.com/u/biha)\
**Post date:** [September 23, 2021, 7:15am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/32 "2021-09-23T07:15:04Z")

</div>

How to see the apps working ?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [September 23, 2021, 7:16am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/33 "2021-09-23T07:16:00Z")

</div>

??? what do you mean?

---

<div class="post-metadata">

**Author:** ![biha](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/biha/32/84110_2.png) [@biha](https://community.glideapps.com/u/biha)\
**Post date:** [September 23, 2021, 7:16am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/34 "2021-09-23T07:16:33Z")

</div>

the builder haha

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [September 23, 2021, 7:18am UTC](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117/35 "2021-09-23T07:18:21Z")

</div>

builder is not a deployed app… so it will work as a in app… you have to test it on defernt devices and OS

[Previous page](https://community.glideapps.com/t/date-in-if-else-column-subtraction/32117.md?page=1)
