HeRoseInThree

Board Regular
Joined
Jan 11, 2018
Messages
103
My formula is :

=DATEDIF(O2,AL$1,"y")&" years, "&DATEDIF(O2,AL$1,"ym")&" months, "&O2-DATE(YEAR(O2),MONTH(O2),1)&" days"

Where O2 is the hire date and AL$1 is today()

The formula works, kinda. It isn't doing the math correctly. I have a person who started exactly a year ago and it is 2 weeks short...
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Welcome to the Board!

I think the problem is your day calculation. Can you explain why you wrote it this way:
Code:
&O2-DATE(YEAR(O2),MONTH(O2),1)&" days"
What that is doing is changing your hire date to the first day of the month they were hired, not the actual day.

I think this may be what you want:
Code:
=DATEDIF(O2,AL$1,"y")&" years, "&DATEDIF(O2,AL$1,"ym")&" months, "&DATEDIF(O2,AL$1,"md")&" days"
 
Upvote 0
That is it!!! Thanks!

I only wrote it that way because I am not that smart and I do not know any better : )
 
Upvote 0
You are welcome!

I hope it makes sense. If you notice, it is structured similarly to the first two parts (years and months).
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,737
Members
449,050
Latest member
excelknuckles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top