# Ask about glide table math

**URL:** <https://community.glideapps.com/t/ask-about-glide-table-math/70809>\
**Category:** Ask for Help\
**Created:** [February 14, 2024, 5:32am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809 "2024-02-14T05:32:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yoga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yoga/32/70778_2.png) [@Yoga](https://community.glideapps.com/u/Yoga)\
**Post date:** [February 14, 2024, 5:32am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/1 "2024-02-14T05:32:16Z")

</div>

Hi again. I am sorry for asking a lot. Kinda new learner here.

I want to ask about some of math or logic in Glide Table. I will start with this :

How can we calculate age in the Glide Table? Let say, I put date of birth in column C, and to calculate in the excel, i will just put the math “=(C-TODAY())/360”

How can this be possible in Glide Table?

thanks a lot.

---

<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:** [February 14, 2024, 6:14am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/2 "2024-02-14T06:14:03Z")

</div>

To get the result in Days, use `Trunc(Now - Date)`

To get it in (approximate) years, use `Trunc(Now - Date)/365.25`

 ![CleanShot 2024-02-14 at 14.12.37@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/d/bd090c151d9278fc439592dcf33b5540da5fe18f.png)

---

<div class="post-metadata">

**Author:** ![Yoga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yoga/32/70778_2.png) [@Yoga](https://community.glideapps.com/u/Yoga)\
**Post date:** [February 14, 2024, 6:55am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/3 "2024-02-14T06:55:41Z")

</div>

Thanks @Darren_Murphy

I want to make condition where I need several columns to be filled (not empty) to get the result COMPLETED. For example, column A, B, C should be not empty.

In Excel, I will type =IF(AND(A=is not empty,B=is not empty,C=is not empty),“COMPLETED”,“INCOMPLETE”)

(i tried to type star sign, but it changes the star character in this conversation)

How can I make this possible in Glide Table? I can’t find the IF function in Glide Table can facilitate AND & OR (joining 2 or more conditions to get 1 result).

---

<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:** [February 14, 2024, 7:14am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/4 "2024-02-14T07:14:03Z")

</div>

You can do it with an if-then-else column as follows:

- If Column A is empty, then null (nothing)
- If Column B is empty, then null
- If Column C is empty, then null
- Else `true`

 ![CleanShot 2024-02-14 at 15.13.20@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/0/c0f888352c46ecdf67da90e419a25c3dfe3ab372.png)

---

<div class="post-metadata">

**Author:** ![Yoga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yoga/32/70778_2.png) [@Yoga](https://community.glideapps.com/u/Yoga)\
**Post date:** [February 14, 2024, 7:16am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/5 "2024-02-14T07:16:48Z")

</div>

Got it. So it is reversed. I will try. Thanks @Darren_Murphy .

---

<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:** [February 14, 2024, 7:18am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/6 "2024-02-14T07:18:28Z")

</div>

Yep, that’s the idea. You just need to work backwards.

---

<div class="post-metadata">

**Author:** ![Yoga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yoga/32/70778_2.png) [@Yoga](https://community.glideapps.com/u/Yoga)\
**Post date:** [February 14, 2024, 7:21am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/7 "2024-02-14T07:21:04Z")

</div>

But I still don’t understand, in your suggestion, if A is empty then null, and B is empty then null,

What if I write the THENs in one of the condition above differently, like if A is empty then “OK”, and B is empty then “not OK”. Else “True”.

If A is not empty but B is empty, what will be the results?

---

<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:** [February 14, 2024, 7:24am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/8 "2024-02-14T07:24:54Z")

</div>

hehe, you’ve confused me a bit with your question there…

But how about if I change my example so it more closely resembles your original question?

 ![CleanShot 2024-02-14 at 15.23.18@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/c/dca821977aabc61e894ae5219e93c06adde9b09d.png)

Does that make more sense?

---

<div class="post-metadata">

**Author:** ![Yoga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yoga/32/70778_2.png) [@Yoga](https://community.glideapps.com/u/Yoga)\
**Post date:** [February 14, 2024, 7:29am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/9 "2024-02-14T07:29:32Z")

</div>

Apologize. I mean, I think the THEN can be filled with different outcomes in each IF. In your example, you can fill THEN for A like “Paris”, and for B, the THEN will be “London”. Else will be “Tokyo”.

If A is true, but B is not true, is the result will be “Tokyo”? Or “Paris”?

---

<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:** [February 14, 2024, 7:38am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/10 "2024-02-14T07:38:30Z")

</div>

The result will be whatever is in the “THEN” for the first one that matches.  
If none of them match, then the final “ELSE” is returned.

So in your example, the result would be “Paris”.

---

<div class="post-metadata">

**Author:** ![Yoga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yoga/32/70778_2.png) [@Yoga](https://community.glideapps.com/u/Yoga)\
**Post date:** [February 14, 2024, 7:39am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/11 "2024-02-14T07:39:55Z")

</div>

I see. If A is not true and B is true, the result will be “London”. Am I correct?

---

<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:** [February 14, 2024, 7:40am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/12 "2024-02-14T07:40:28Z")

</div>

Correct 👍

---

<div class="post-metadata">

**Author:** ![Yoga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yoga/32/70778_2.png) [@Yoga](https://community.glideapps.com/u/Yoga)\
**Post date:** [February 14, 2024, 7:43am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/13 "2024-02-14T07:43:05Z")

</div>

Interesting.

What if it is more than two, like, A B C and so on… for example :

A if true “Paris”  
B if true “London”  
C if true “New York”

Else “Tokyo”

If A is false, but B and C is true, will the result is the THEN in B and C combined? Become “London New York”. Or What?

---

<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:** [February 14, 2024, 7:46am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/14 "2024-02-14T07:46:15Z")

</div>

No, just the first one that is true.  
So the result in that case would be “London”.

---

<div class="post-metadata">

**Author:** ![Yoga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yoga/32/70778_2.png) [@Yoga](https://community.glideapps.com/u/Yoga)\
**Post date:** [February 14, 2024, 7:46am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/15 "2024-02-14T07:46:54Z")

</div>

Okay. That answers. Thanks Darren!

---

<div class="post-metadata">

**Author:** ![Yoga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yoga/32/70778_2.png) [@Yoga](https://community.glideapps.com/u/Yoga)\
**Post date:** [February 14, 2024, 7:54am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/16 "2024-02-14T07:54:44Z")

</div>

Your example here is quite interesting.

In row 1 and 3, even though the column A is not empty (false), the result in column D is “Not Completed” (true). Is the condition B and C calculated here?

I am confused.

---

<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:** [February 14, 2024, 8:04am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/17 "2024-02-14T08:04:50Z")

</div>

Keep in mind that it is giving a separate result for each row, based on the data in that row.

- For Row 1:  
– A is not empty (first condition fails)  
– B is empty (second condition passes - result is “Not Completed”)
- For Row 2:  
– A is not empty (first condition fails)  
– B is not empty (second condition fails)  
– C is not empty (third condition fails)  
– As all 3 conditions fail, the ELSE is returned - result is “Conpleted”
- For Row 3:  
– A is not empty (first condition fails)  
– B is not empty (second condition fails)  
– C is empty (third condition passes - result is “Not Completed”)

---

<div class="post-metadata">

**Author:** ![Yoga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yoga/32/70778_2.png) [@Yoga](https://community.glideapps.com/u/Yoga)\
**Post date:** [February 14, 2024, 8:10am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/18 "2024-02-14T08:10:33Z")

</div>

What if there’s row 4 :

A is empty (first condition passes)  
B is not empty (second condition fails)  
C is not empty (third condition fails)

I tried this and it results “Not completed”. Even though the first condition passes. And please pardon me for my confusion here.

---

<div class="post-metadata">

**Author:** ![Yoga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/yoga/32/70778_2.png) [@Yoga](https://community.glideapps.com/u/Yoga)\
**Post date:** [February 14, 2024, 8:12am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/19 "2024-02-14T08:12:42Z")

</div>

I think I already get the idea.

---

<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:** [February 14, 2024, 8:13am UTC](https://community.glideapps.com/t/ask-about-glide-table-math/70809/20 "2024-02-14T08:13:08Z")

</div>

Yes, that’s as expected. The first condition passed, and so it returns whatever is in the “THEN” for that condition - which is “Not Completed”.

I know it can be a bit confusing, because the logic seems reversed. But once you get your head around it, it’s actually quite powerful.

[Next page](https://community.glideapps.com/t/ask-about-glide-table-math/70809.md?page=2)
