# How to get user age from birthday

**URL:** <https://community.glideapps.com/t/how-to-get-user-age-from-birthday/41507>\
**Category:** Ask for Help\
**Created:** [May 1, 2022, 4:47pm UTC](https://community.glideapps.com/t/how-to-get-user-age-from-birthday/41507 "2022-05-01T16:47:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![viva\_la](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/viva_la/32/42176_2.png) [@viva\_la](https://community.glideapps.com/u/viva_la)\
**Post date:** [May 1, 2022, 4:47pm UTC](https://community.glideapps.com/t/how-to-get-user-age-from-birthday/41507/1 "2022-05-01T16:47:12Z")

</div>

Hi! I’m trying to get relative user age from entered birthdate. It’s not so easy, so i created one column with relative date between now and birthdate in mini format, then i created yet another column to replace “yr” with empty string (some kinda strcut or trim).

Now i got “25” from DD-MM-YYYY format, BUT this is not a number, so i can’t create IF column like “IF AGE \> 18 THEN” because IF-type-column shows this options (e,gt,lt,etc) only for Number format columns.

How could i get Number-type column, contains age from date-time birthday?

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [May 1, 2022, 4:49pm UTC](https://community.glideapps.com/t/how-to-get-user-age-from-birthday/41507/2 "2022-05-01T16:49:04Z")

</div>

all rows must be numbers, then glide will read values as numbers, you need to replace empty values with 0

---

<div class="post-metadata">

**Author:** ![viva\_la](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/viva_la/32/42176_2.png) [@viva\_la](https://community.glideapps.com/u/viva_la)\
**Post date:** [May 1, 2022, 5:04pm UTC](https://community.glideapps.com/t/how-to-get-user-age-from-birthday/41507/3 "2022-05-01T17:04:04Z")

</div>

There is no any empty rows in my table:

> **[2022-05-01-20-04-55](https://ibb.co/WGRkVsj)**
>
> Image 2022-05-01-20-04-55 hosted in ImgBB

> **[2022-05-01-20-05-06](https://ibb.co/NtF008c)**
>
> Image 2022-05-01-20-05-06 hosted in ImgBB

Column 1: “\<\> Age”  
Column 2: “132 Age”  
Column 3: “IF-THEN-ELSE Age”

I want to create the column 3 with this logic:

IF “\<\> Age” IS GREATER THEN 18 THEN 1 ELSE 0

But it s impossible without column 2 (“123 Age”) as i see

---

<div class="post-metadata">

**Author:** ![Uzo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/uzo/32/22639_2.png) [@Uzo](https://community.glideapps.com/u/Uzo)\
**Post date:** [May 1, 2022, 5:07pm UTC](https://community.glideapps.com/t/how-to-get-user-age-from-birthday/41507/4 "2022-05-01T17:07:29Z")

</div>

what function are you using to get the age number?  
try to do math column and multiply age by 1, it should convert to number

---

<div class="post-metadata">

**Author:** ![viva\_la](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/viva_la/32/42176_2.png) [@viva\_la](https://community.glideapps.com/u/viva_la)\
**Post date:** [May 1, 2022, 5:17pm UTC](https://community.glideapps.com/t/how-to-get-user-age-from-birthday/41507/5 "2022-05-01T17:17:01Z")

</div>

Thanks a lot!

1. Column#1 with relative date between now and birthdate
2. column#2 with Text function replacing “yr” in “25yr” to “” (25yr → 25)
3. MATH column that make int from string with math function “column#2+1-1”
4. so after that i could use it in IF-THEN-ELSE column!

---

<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:** [May 1, 2022, 9:12pm UTC](https://community.glideapps.com/t/how-to-get-user-age-from-birthday/41507/6 "2022-05-01T21:12:44Z")

</div>

Another solution is a math column with the following formula:

```auto
floor((year(now)-date)/365.25)

```

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [May 2, 2022, 9:12pm UTC](https://community.glideapps.com/t/how-to-get-user-age-from-birthday/41507/7 "2022-05-02T21:12:49Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
