PDA

View Full Version : DATEDIF function not found


eliW
07-15-2002, 07:49 AM
Hi All,

I have Excel 97 Hebrew version
I want to use DATEDIF formula but it isn't in my list.
What is the problem?

Eli

cfcanter
07-15-2002, 12:16 PM
I checked my xl 2000. I do not have datediff function and I don't believe my xl 97 at home has it either.

By and large, xl doesn't need date dif. If your dates are in text try this:

10-may-98 35925 <== datevalue (a1)
15-may-98 35930 <== datevalue(a2)
difference 5

If the data is in dates, simply subtract one from the other:

10-May-02 10-May-01 365.00

The tricky part come in converting days to weeks or months.

10-May-02 10-May-01 (a1-b1)/12

Hope-this-helps
Shalom

tagger418
07-15-2002, 04:25 PM
Go to Tools > Add-ins
Add the Data Analysis Toolpak

cfcanter
07-15-2002, 04:28 PM
I don't have the Data Analysis Toolpak. I have Analysis Toolpak but that does not bring up DateDiff function. Must be something my MIS guys forgot.

eliW
07-16-2002, 02:54 AM
Thank you for your replies, but I am still cofused.

I have Analysis ToolPack but cannot find the DATEDIF function.

Look also at this link:

http://www.mrexcel.com/board/viewtopic.php?topic=9502&forum=2

Can anybody help?

Eli

cfcanter
07-16-2002, 01:20 PM
It appears xl is not consistent as to whether the DATEDIF function is available or not.

Bottom line, I wouldn't spend any more time looking for it. xl will subtract dates and you cna convert to weeks, months, etc. If I can help further, post a sample of your spreadsheet.

good luck

tagger418
07-16-2002, 03:41 PM
If the Analysis Toolpak is installed, then DATEDIF is available however it will not appear in the function menu. Here is the help file from Excel to explaine its use:

DATEDIF
See also

Calculates the number of days, months, or years between two dates. This function is provided for compatibility with Lotus 1-2-3.

Syntax

DATEDIF(start_date,end_date,unit)

Start_date is a date that represents the first, or starting, date of the period. Dates may be entered as text strings within quotation marks (for example, "2001/1/30"), as serial numbers (for example, 36921, which represents January 30, 2001, if you're using the 1900 date system), or as the results of other formulas or functions (for example, DATEVALUE("2001/1/30")). For more information about date serial numbers, see NOW.

End_date is a date that represents the last, or ending, date of the period.

Unit is the type of information you want returned.

Unit Returns
"Y" The number of complete years in the period.
"M" The number of complete months in the period.
"D" The number of days in the period.
"MD" The difference between the days in start_date and end_date. The months and years of the dates are ignored.
"YM" The difference between the months in start_date and end_date. The days and years of the dates are ignored.
"YD" The difference between the days of start_date and end_date. The years of the dates are ignored.


Remarks

Microsoft Excel stores dates as sequential serial numbers so that it can perform calculations on them. Excel stores January 1, 1900, as serial number 1 if your workbook uses the 1900 date system. If your workbook uses the 1904 date system, Excel stores January 1, 1904, as serial number 0 (January 2, 1904, is serial number 1). For example, in the 1900 date system, Excel stores January 1, 1998, as serial number 35796 because it is 35,795 days after January 1, 1900. Learn more about how Microsoft Excel stores dates and times.


Excel for Windows and Excel for the Macintosh use different date systems as their default. For more information, see NOW.
Examples

DATEDIF("2001/1/1","2003/1/1","Y") equals 2, or two complete years in the period.

DATEDIF("2001/6/1","2002/8/15","D") equals 440, or 440 days between June 1, 2001, and August 15, 2002.

DATEDIF("2001/6/1","2002/8/15","YD") equals 75, or 75 days between June 1 and August 15, ignoring the years of the dates.

DATEDIF("2001/6/1","2002/8/15","MD") equals 14, or the difference between 1 and 15 — the day of start_date and the day of end_date — ignoring the months and the years of the dates.

MikeR
07-16-2002, 06:29 PM
Analysis Toolpak not needed for 97 and 2000. See http://www.cpearson.com/excel/datedif.htm for more complete information.

FWIW