DATEDIF generating error

  • Thread starter Thread starter user
  • Start date Start date
U

user

DATEDIF is generating a #NAME? error; though, it appears in the help
pages, and I have the analysis toolpak loaded (Win 2000, Excel 2000).
Can someone help here?

I found how to do the following in "xlfdic01.xls".

I will use some simple math to determine periods in the form, "13 wk 4
d". Week and day units should suffice. Is it possible to get week and
day units output to a single cell?

Thank you.

Deric
 
=DATEDIF(start,end,"y")

the example above is for years, there can be "y", "ym","m", "md" and "d"

Can you post what's in start and end in your formula
 
Hi Deric
sound like you are not using only cell references in your DATEDIF
parameter list. e.g. something like
=DATEDIF(A1,asc,d)
would cause this error. You may post your exact formula together with
the values in the referenced cells
 
=INT(DATEDIF(D$5,D32,"D")/7) & " wk " & MOD(DATEDIF(D$5,D32,"D"),7) &
d"

Thank you guys. I finally got it working. The day specificatio
needed to be in double quotes; "d".

The command will not track backward to get negative days (day
preceeding). Also, I have not yet tried an "if" statement to void th
"0 wk" output within the first week of a reference.


Deri
 
Hi Deric!

Re: The command will not track backward to get negative days (days
preceding). Also, I have not yet tried an "if" statement to void the
"0 wk" output within the first week of a reference.

This more complex version will cover those problems:

=IF(D$5<D32,IF(INT(DATEDIF(D$5,D32,"D")/7)=0,MOD(DATEDIF(D$5,D32,"D"),
7),INT(DATEDIF(D$5,D32,"D")/7) & " wk " &
MOD(DATEDIF(D$5,D32,"D"),7))&" d","-"&
IF(INT(DATEDIF(D32,D$5,"D")/7)=0,MOD(DATEDIF(D32,D$5,"D"),7),INT(DATED
IF(D32,D$5,"D")/7) & " wk " & MOD(DATEDIF(D32,D$5,"D"),7))&" d")

It covers:

D5 later than D32 by switching start date and end date in the formula
(and inserting a preceding "-"
Removes the calculation of the weeks if the integer of the difference
is 0.


--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Back
Top