# How to get user age from birthday

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?

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

There is no any empty rows in my table:

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

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

1 Like

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!
2 Likes

Another solution is a math column with the following formula:

``````floor((year(now)-date)/365.25)
``````
3 Likes

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