SOLVED

date calculation issues

Copper Contributor

JoAnnDP_0-1660204005418.png

trying to get the "years" between birth date and today

i've changed the colum (birth date) to custom dd-mmmm-yy but it stays as is 07.08.22 - which makes my formula #VALUE

when i manually changed the birth date colum to 07-Aug-22 my formula works but there are 2200+ birth dates and i dont have time to manually change all of them.... please help?

JoAnnDP_1-1660204185285.png

 

3 Replies

@Jo-AnnDP 

 

If all your Birth Dates end with 2 digits and you're only looking to get Year(s) diff. a simple solution in F2: =RIGHT(E2,2) - RIGHT(D2,2)

 

_Screenshot.png

Otherwise in G2:

=DATEDIF(--SUBSTITUTE(D2,".","/"), --SUBSTITUTE(E2,".","/"), "y")

 

best response confirmed by Hans Vogelaar (MVP)
Solution

@Jo-AnnDP That's because the date columns contain texts. Your system doesn't recognize dates with the dot between the day, month and year.

Select the Birthdate column. On the Data ribbon select Text to Columns. Advance to step 3 without changing anything.

In Step 3 set the column type to Date and select DMY. Press Finish. That should transform the "dates with dots" to valid dates for your system settings.

Riny_van_Eekelen_0-1660205880811.png

 

@riny thank you the text to columns worked perfectly
1 best response

Accepted Solutions
best response confirmed by Hans Vogelaar (MVP)
Solution

@Jo-AnnDP That's because the date columns contain texts. Your system doesn't recognize dates with the dot between the day, month and year.

Select the Birthdate column. On the Data ribbon select Text to Columns. Advance to step 3 without changing anything.

In Step 3 set the column type to Date and select DMY. Press Finish. That should transform the "dates with dots" to valid dates for your system settings.

Riny_van_Eekelen_0-1660205880811.png

 

View solution in original post