View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JL[_4_] JL[_4_] is offline
external usenet poster
 
Posts: 1
Default Date since hired displayed in years.months

Hi,
I have a spreadsheet that calculated the time a person has been working for
the company. However in some cases I have not been given the date hired so
my results are incorrect.

I am using the formula

=DATEDIF(D27,TODAY(),"Y") & "." & DATEDIF(D27,TODAY(),"YM")

Where D27 refers to the date in the previous column. If the date column is
empty the result is something like 106.4 meaning 106 years and 4 months.

The formula works great in all other circumstances giving results such as
7.3 for seven years three months.

Is there a way to check to see if the date field is empty first, then make
the result field remain empty, and then still work on the other fields?

Can anyone modify the above code to check first for an empty field?

Thanks

JL