What is the formula to get the age of the contact?
Thanks
What is the formula to get the age of the contact?
Thanks
I got it. Never mind.
Just curious. How did you do it?
LIKE THIS minus the quotes
" (DAYS(TODAY(),BIRTHDATE)*12/365.2524)/12 "
I had to add the quotes to get the post to save.
Cool, thanks John! I’m gonna use that to calculate retention.
hi, my question is related to the original post - how can I see a more precise representation of a person’s age - i.e. years +MONTHS? this is very important to me, and I have achieved this in Airtable, it looks like this:
For it I used this formula, but it doesn’t seem to work in Infinity:
IF( {DOB}, CONCATENATE(ROUNDDOWN((DATETIME_DIFF(TODAY(),DOB, ‘months’)/12), 0))&"."&((DATETIME_DIFF(TODAY(),DOB, ‘months’))-(DATETIME_DIFF(TODAY(),DOB, ‘years’))*12) )
can anybody please help me to figure out this one, I am sure there are other people who will find it usefull.
This is the formula for the years:
INT(DAYS(TODAY(),DOB)*12/365.2524/12)
Maybe you could use another formula attribute for the months:
INT(12*((DAYS(TODAY(),DOB)*12/365.2524/12)-INT(DAYS(TODAY(),DOB)*12/365.2524/12)))
It´s not exact as it does not differenciate between days of the month, but at least it´s pretty close.
I don’t know how to merge it into one attribute. Have you contacted the chat support already? they might be able to help you on.
Hi @5555dimitri
Unfortunately it wouldn’t be possible to combine the two inside one attribute years + months, that would require two different results which isn’t something our attributes really accept (or work as).
In both cases the result is a number (how many months, how many years), you can only add them together, divide them or similar, but you can’t get 2 different results in the same attribute, unfortunately!
So, I would suggest creating 2 different attributes, just as @micck mentioned below, and have one attribute for years(age), another one for months, you can set them next to each other and see exactly the number of years and months.
This whole scenario might be different once we introduce new attributes to our formula, when we implement additional formulas and so much more, however - we have yet to work on that and see what users want / need regarding formulas.
Hopefully that helps @5555dimitri
hi again everyone,
So I stumbled upon another problem and decided to re-open this thread as @micck 's formula works perfectly to show the number of months, but he problem is that I still cannot get my sorting right to see what the proper chronological order is
You can see that in the screenshot
I thought maybe a better Idea would be to count the number of days after last birthday , rather then the number of months ? This way sorting will most surely work. (but there is now way I will be able to come up with this formula on my own)
Can you please help ?
This would display the days since the last birthday:
INT(days(today(),DOB))-INT(DAYS(TODAY(),DOB)/365.2524)*365.2524
Explanation
INT(days(today(),DOB)) = calculates the whole number of days between today and DOB
INT(DAYS(TODAY(),DOB)/365.2524) = calculates the whole number of years
*365.2524 = converts the whole number of years into days.
The sorting functions fine that way.