View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default DATEDIF formula enhancement

Come to think of it, so does David's, so you had two solutions exactly as
required 11 hours before Sandy posted.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Santa-D" wrote in message
oups.com...
Sandy Mann wrote:
If I follow what you are trying to do try:

=DATEDIF(G7,H7+1,"y") & " years, " & DATEDIF(G7,H7+1,"ym") & " months, "
&DATEDIF(G7,H7+1,"md") & " days"

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Thanks Sandy, that worked a treat.
The result comes up as "10 years, 0 months, 0 days" what I was hoping
to do was to have the result display as "10 years" and exclude months &
days as they are equal to 0.

I'm not sure if what I want to do can be done in an excel function
without having to enter into VBA.

Can it be done at all?