Thread: math with year
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Clayman Clayman is offline
external usenet poster
 
Posts: 95
Default math with year

The form does require hire year in addition. Not my code, but the form
itself. Thanks for the tip, though!
--
Adios,
Clay Harryman


"Mike H" wrote:

Clayman,

Glad you worked it out but you didn't need to extract the year into a
seperate cell to do your calculation, you could have done:-

=YEAR(TODAY())-YEAR(C4)

Mike


"Clayman" wrote:

I need to calculate years of service. I have the hire date in date format
(ex: 10/04/1998 - in cell C4). I have extracted the hire year in D4 using
=YEAR(C4). So far, so good.
C4=hire date
D4=YEAR(C4)

When I try this formula for years of service: =YEAR(TODAY())-YEAR(C4), I get
00.
When I try this formula: =YEAR(TODAY()-D4), I get 05.

Nevermind - I figured out the answer while posting the question. But in case
others have the same question, here's the formula I used:

=VALUE(YEAR(TODAY()))-VALUE(D4)

It works. :)

Thanks for all your help!
--
Adios,
Clay Harryman