View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Norman Harker Norman Harker is offline
external usenet poster
 
Posts: 162
Default DateDiff("w") -- problem

Hi zSplash!

I think that you are misunderstanding what DATEDIFF means by "w" and
"ww" arguments.

Extract from Help:

When interval is Weekday ("w"), DateDiff returns the number of weeks
between the two dates. If date1 falls on a Monday, DateDiff counts the
number of Mondays until date2. It counts date2 but not date1. If
interval is Week ("ww"), however, the DateDiff function returns the
number of calendar weeks between the two dates.

Both are counting weeks which is why in your case you are getting the
same answer.

To count weekdays use the Analysis ToolPak NETWORKDAYS function.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia

Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
"zSplash" wrote in message
...
I am trying to count weekdays, using the "w" argument

unsuccessfully. I get
the same value for "w" (weekday) as I do for "ww" (week). What am I

doing
wrong?
Code:
estDays=DateDiff("w", ufm1.Calendar1, ufm1.Calendar2)

TIA