Excel: Years of Service

I need a formula that will convert these two columns to a date.  Now I can do that by
=DATE(LEFT(E1,4),MID(E1,5,2),MID(E1,7,2))    and

but now I need to subtract Column E (start date) from Column F (Today's date) to calculate the length of time the employee has worked for the company.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

[ fanpages ]IT Services ConsultantCommented:
Simply... the number of days will be:

=DATE(LEFT(F1,4),MID(F1,5,2),MID(F1,7,2)) - DATE(LEFT(E1,4),MID(E1,5,2),MID(E1,7,2))

You can then format that according to your needs, for example:

=DATEDIF(DATE(LEFT(E1,4),MID(E1,5,2),MID(E1,7,2)),DATE(LEFT(F1,4),MID(F1,5,2),MID(F1,7,2)),"y")&" years "&DATEDIF(DATE(LEFT(E1,4),MID(E1,5,2),MID(E1,7,2)),DATE(LEFT(F1,4),MID(F1,5,2),MID(F1,7,2)),"ym")&" months "&DATEDIF(DATE(LEFT(E1,4),MID(E1,5,2),MID(E1,7,2)),DATE(LEFT(F1,4),MID(F1,5,2),MID(F1,7,2)),"md")&" days"

Open in new window

Please see columns [J], [K], [L], & [O] within the attached workbook.
kvrogersAuthor Commented:
THANK YOU.  I am sending for verification and will close if accepted.  

kvrogersAuthor Commented:
She said this is perfect but she wants to know what is the average # of years that employees have worked for the company,
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

[ fanpages ]IT Services ConsultantCommented:
OK, thank you for confirming the initial question has been answered as expected.

With the extended query, does your colleague wish to take account of local Public Holidays (& ignore any personal vacation time/any other absences)?  I am presuming this is probably too much to consider.

If the figure required is simply the total of all the days SUM(L1:L2379) = 8,900,970 divided by the number of employees (2379) with the result shown in years...

8,900,970 / 2,379 = 3,741.47541 (10 years 3 months 29 days)

See cell [O2382] of the updated attachment.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kvrogersAuthor Commented:
Thank you again.  
kvrogersAuthor Commented:
I hope I gave you credit for everything you helped me with.  I am very grateful.

[ fanpages ]IT Services ConsultantCommented:
Yes; no issues at all.

Thanks for closing the question so promptly.

Good luck with the rest of the project.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.