Hi Bob!
Help warns against strings being used in various date functions. In my
view the warnings are a little too strong and would be best replaced
by advice to use "unequivocal formats".
I did some work on this and the following strings all appear to be
acceptable and unequivocal for at least three English language
versions of Excel (English, Australian, US).
12 January 2002
12-January-2002
12/January/2002
12 Jan 2002
12-Jan-2002
12/Jan/2002
2002-01-12
2002/01/12
2002/1/12
Of these, only the final three will be largely "Regional Settings
immune" because the other six require English language versions. (FAOD
includes USA). Since number 7 (yyyy-mm-dd) is the ISO8601:2000
approved separated date format, I'd go for that one. In Canada, or
Europe I think it would be asking for trouble insisting on an English
language version of Excel.
I've tested:
=SUMPRODUCT((A1:A300>="2004-04-01"*1)*(A1:A300<="2004-04-07"*1))
This seems to work OK. It's a bit foreign to most of us although it is
being brought in for EEC purposes and is the long standing method used
in China.
For fixing to the current year, my preference would be to go the whole
hog and use DATE.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
[email protected]
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.