Ask about glide table math

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.

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

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

1 Like

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).

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

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

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

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?

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?

Does that make more sense?

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”?

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”.

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

Correct :+1:

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?

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

Okay. That answers. Thanks Darren!

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.

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”)

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.

I think I already get the idea.

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.

1 Like