Yet ANOTHER piece of MS Office Brilliance
-
In an Excel spreadsheet, enter the following two dates: 01-Feb-1900 01-Mar-1900 In another cell, subtract the first from the second and set the formatting to general, Look at the result. In VBA (just because you're in Excel anyway), from the immediate window enter: ? datediff("d","01-Feb-1900","01-Mar-1900") Check the result. The VBA result is correct... This goes back to my college days.
-
In an Excel spreadsheet, enter the following two dates: 01-Feb-1900 01-Mar-1900 In another cell, subtract the first from the second and set the formatting to general, Look at the result. In VBA (just because you're in Excel anyway), from the immediate window enter: ? datediff("d","01-Feb-1900","01-Mar-1900") Check the result. The VBA result is correct... This goes back to my college days.
I think it's down to the problem mentioned here[^] - for compatibility's sake they replicated a bug in Lotus 123, which thought that 1900 was a leap year.
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
-
In an Excel spreadsheet, enter the following two dates: 01-Feb-1900 01-Mar-1900 In another cell, subtract the first from the second and set the formatting to general, Look at the result. In VBA (just because you're in Excel anyway), from the immediate window enter: ? datediff("d","01-Feb-1900","01-Mar-1900") Check the result. The VBA result is correct... This goes back to my college days.
Excel is horrible at a number of things. What causes me much trouble is that there are some string values, e.g.
1DEC
, that I am supposed to get from a database, but because along the way from their point of origin to my source they pass through Excel, they come in as12/1/2013
(whatever the current year is). :omg: So then my ETL process has to detect these and correct them. -
In an Excel spreadsheet, enter the following two dates: 01-Feb-1900 01-Mar-1900 In another cell, subtract the first from the second and set the formatting to general, Look at the result. In VBA (just because you're in Excel anyway), from the immediate window enter: ? datediff("d","01-Feb-1900","01-Mar-1900") Check the result. The VBA result is correct... This goes back to my college days.
http://support.microsoft.com/kb/214326[^] Yep... To be fair, though, it won't be wrong again for 85 more years...
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels) -
http://support.microsoft.com/kb/214326[^] Yep... To be fair, though, it won't be wrong again for 85 more years...
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)Ian Shlasko wrote:
it won't be wrong again for 85 more years...
Only if your computer's clock gets reset:
http://support.microsoft.com/kb/214326[^]
NOTE: Microsoft Excel correctly handles all other leap years, including century years that are not leap years (for example, 2100). Only the year 1900 is incorrectly handled.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
I think it's down to the problem mentioned here[^] - for compatibility's sake they replicated a bug in Lotus 123, which thought that 1900 was a leap year.
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
Backward compatibility is the cause of numerous problems in computing, I believe.
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
-
I think it's down to the problem mentioned here[^] - for compatibility's sake they replicated a bug in Lotus 123, which thought that 1900 was a leap year.
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================
Wrong is evil and must be defeated. - Jeff Ello
-
I think it's down to the problem mentioned here[^] - for compatibility's sake they replicated a bug in Lotus 123, which thought that 1900 was a leap year.
========================================================= I'm an optoholic - my glass is always half full of vodka. =========================================================