# If Else Discards The unit

**URL:** <https://community.glideapps.com/t/if-else-discards-the-unit/42819>\
**Category:** Report a Bug\
**Created:** [June 8, 2022, 7:58am UTC](https://community.glideapps.com/t/if-else-discards-the-unit/42819 "2022-06-08T07:58:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yasin\_Hassanien](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yasin_hassanien/32/9042_2.png) [@Yasin\_Hassanien](https://community.glideapps.com/u/Yasin_Hassanien)\
**Post date:** [June 8, 2022, 7:58am UTC](https://community.glideapps.com/t/if-else-discards-the-unit/42819/1 "2022-06-08T07:58:42Z")

</div>

Please see attached the if else is missing the unit

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

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [June 8, 2022, 11:44pm UTC](https://community.glideapps.com/t/if-else-discards-the-unit/42819/2 "2022-06-08T23:44:07Z")

</div>

Yes, this is unfortunately expected behavior because “1” doesn’t follow the same format as “n months”. I agree that it’s a bit frustrating and that the if then else should retain units pulled in from number, math and rollup columns. @Jason

---

<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 9, 2022, 12:01am UTC](https://community.glideapps.com/t/if-else-discards-the-unit/42819/3 "2022-06-09T00:01:47Z")

</div>

In the meantime, you can try creating a template column to lock in the formatting in between the MATH and the IF columns.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [June 9, 2022, 12:27am UTC](https://community.glideapps.com/t/if-else-discards-the-unit/42819/4 "2022-06-09T00:27:45Z")

</div>

👆 this

---

<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 9, 2022, 9:41am UTC](https://community.glideapps.com/t/if-else-discards-the-unit/42819/5 "2022-06-09T09:41:09Z")

</div>

Yeah, I reported this last year, and (obviously) it’s still an issue.  
Jeff’s workaround is fine, except that sometimes you need to perform further calculations with the output of the if-then-else column, which you can’t (easily) do if it’s outputting a template (string) value. In cases like that, what I normally do is use a second math column _after_ the if-then-else, just for the purpose of re-attaching the units and resetting the precision.

This can all get quite frustrating, especially when working with dates and times.

---

<div class="post-metadata">

**Author:** ![Yasin\_Hassanien](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yasin_hassanien/32/9042_2.png) [@Yasin\_Hassanien](https://community.glideapps.com/u/Yasin_Hassanien)\
**Post date:** [June 9, 2022, 9:58am UTC](https://community.glideapps.com/t/if-else-discards-the-unit/42819/6 "2022-06-09T09:58:22Z")

</div>

The workaround Jeff is proposing will work of course but it will be a mass column created for these types of checks as each column should have a template column, when I thought about it already and am already am using it but the time consumption to apply this each time is dramatically painful

Thanks, guys for your advice hope this can be resolved by Glide Team soon

---

<div class="post-metadata">

**Author:** ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)\
**Post date:** [June 9, 2022, 1:12pm UTC](https://community.glideapps.com/t/if-else-discards-the-unit/42819/7 "2022-06-09T13:12:53Z")

</div>

Hola,

My workaround in order to avoid creating new rows and getting the result in one column

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

**Option #1: via Javascript**

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

**Option #2: via Excel plugin**

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/1/818fb5af4e42fe0dae8dae1a68be6608188b15cb.png)

The only disadvantage is that the result is a text but depending on case, it can be enough.

Saludos!
