# Math calculation between rows

**URL:** <https://community.glideapps.com/t/math-calculation-between-rows/68988>\
**Category:** Ask for Help\
**Created:** [December 25, 2023, 5:41am UTC](https://community.glideapps.com/t/math-calculation-between-rows/68988 "2023-12-25T05:41:46Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [December 25, 2023, 11:07am UTC](https://community.glideapps.com/t/math-calculation-between-rows/68988/6 "2023-12-25T11:07:10Z")

</div>

> [@Bander](#):
>
> I had watched that video but I still find the IF formulas to be lacking. For example I want to do another IF formula in the “else” response.

Next time you hit one of those cases, share it here and we’ll see if we can help with a way.  
When you have multiple conditions or need to do a combination of AND/OR, generally the way is to work backwards and eliminate all the failing conditions first. One important thing to be aware of is that the if-then-else column will return as soon as it meets a matching condition, and you can take advantage of that.

For example, let’s say you want to express the following logic in an if-then-else column:

- If A is `true` AND (B \> 10 OR C \> 10), then `true`

At first glance you might think the above isn’t possible, but it’s actually quite simple. It’s just a matter of reversing the test for A, and short circuiting the flow if it doesn’t pass. So…

- If A is not checked, then `null`
- If B is greater than 10, then `true`
- If C is greater than 10, then `true`

Which gives:

 ![CleanShot 2023-12-25 at 19.03.23@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/8/d8e59da80ed55a7b9784ce22476a40a438cca79d.png)

 ![CleanShot 2023-12-25 at 19.03.40@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/b/9b665bf1268a09198ef5f88e4839aaa518749df0.png)

The above approach won’t work for all cases, but it will work for many.  
All that said - yes, it could be better. And you’re not the first one to have mentioned that.

> [@Better and more consistent IF THEN logic](https://community.glideapps.com/t/better-and-more-consistent-if-then-logic/24317):
>
> I’ve spent the past few days trying to work out some IF/THEN logic for a side project. The problem is that this is something I could have worked out in a matter of a few minutes with actual code. I’m running into several limitations with the current IF/THEN logic we currently have in Glide. First of all there inconsistencies between what’s possible with an IF/THEN column, and what’s possible with If/Then logic in visibility conditions or actions. Most importantly, an IF/THEN column only all…

---

_[View the full topic](https://community.glideapps.com/t/math-calculation-between-rows/68988)._
