# Round Up to 0

**URL:** https://community.glideapps.com/t/round-up-to-0/13613
**Category:** Ask for Help
**Created:** [August 5, 2020, 5:17pm UTC](https://community.glideapps.com/t/round-up-to-0/13613 "2020-08-05T17:17:43Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Kelli\_Williams](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kelli_williams/32/11622_2.png) [@Kelli\_Williams](https://community.glideapps.com/u/Kelli_Williams)
#### Post date: [August 5, 2020, 5:17pm UTC](https://community.glideapps.com/t/round-up-to-0/13613/1 "2020-08-05T17:17:43Z")

</div>

I have a math column right now called TOTAL HEALTH that adds in the values from 3 other columns (more will be added).  
I never want it to display negative amounts. I want it to default to 0 if the TOTAL HEALTH ever goes below 0.

For example, user has 5 TOTAL HEALTH. Some happens where they get hit for -8. I do not want the TOTAL HEALTH column to show -3. I want it to recognize that it is going to be less than 0 so default it to 0.

---

<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: [August 5, 2020, 5:27pm UTC](https://community.glideapps.com/t/round-up-to-0/13613/2 "2020-08-05T17:27:36Z")

</div>

You can create an if then column that will check if the value is below zero. If it is, then return zero. If it’s a positive number, then return the number. You can display the if then column value in your app.

---

<div class="post-metadata">

### Author: ![Kelli\_Williams](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kelli_williams/32/11622_2.png) [@Kelli\_Williams](https://community.glideapps.com/u/Kelli_Williams)
#### Post date: [August 5, 2020, 5:31pm UTC](https://community.glideapps.com/t/round-up-to-0/13613/3 "2020-08-05T17:31:28Z")

</div>

That solved it with the exception of transferring over the units. I used a heart emoji for my total health column. With this new if-then column, it is only taking the value. Any fix for that?

---

<div class="post-metadata">

### Author: ![Kelli\_Williams](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kelli_williams/32/11622_2.png) [@Kelli\_Williams](https://community.glideapps.com/u/Kelli_Williams)
#### Post date: [August 5, 2020, 5:32pm UTC](https://community.glideapps.com/t/round-up-to-0/13613/4 "2020-08-05T17:32:55Z")

</div>

Nevermind, I figured it out. Made a template column and added in the units. I can display that template column then. Thanks for your help!

---

<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: [August 5, 2020, 5:42pm UTC](https://community.glideapps.com/t/round-up-to-0/13613/5 "2020-08-05T17:42:47Z")

</div>

If you don’t want to use extra column(s) then you can use ArrayFormula in googlesheet as below where E2, F2, G2… are your columns to calculate sum.

={“Total”;ARRAYFORMULA(if(E2:E\<\>"",(if(E2:E +F2:F \< 0,“❤”,E2:E + F2:F)),""))}

 ![Screenshot 2020-08-05 at 9.41.09 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/a/a2a0aa547fab859d070a1c0b8a3de6c04e094f8c.png)

---

<div class="post-metadata">

### Author: ![Kelli\_Williams](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kelli_williams/32/11622_2.png) [@Kelli\_Williams](https://community.glideapps.com/u/Kelli_Williams)
#### Post date: [August 5, 2020, 7:01pm UTC](https://community.glideapps.com/t/round-up-to-0/13613/6 "2020-08-05T19:01:33Z")

</div>

Hi…I just noticed one problem. So I can set that the user goes back to 0 using the if-then column as what they see. However, that math column still has them at -3. So if they complete a challenge that earns them 5 health, they are only getting to +2

---

<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: [August 8, 2020, 9:26pm UTC](https://community.glideapps.com/t/round-up-to-0/13613/7 "2020-08-08T21:26:34Z")

</div>

Yeah, I figured that would be the next issue. What you may need to do is create another math column that adds the 3 other columns together (X). Then create another match column that multiples the value by -1 (Y). Then create and if then column that checks if the total health in the (X) is equal or greater than zero and return 0. Else return the value from the (Y) column. Make this final if/then column part of the math for your original health total column. That way if the health value ever becomes less than zero, it will add the inverse of that difference, otherwise it will just add zero.
