Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Yet ANOTHER piece of MS Office Brilliance

Yet ANOTHER piece of MS Office Brilliance

Scheduled Pinned Locked Moved The Weird and The Wonderful
questionlounge
8 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tim Carmichael
    wrote on last edited by
    #1

    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.

    C P I 3 Replies Last reply
    0
    • T Tim Carmichael

      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.

      C Offline
      C Offline
      Chris Quinn
      wrote on last edited by
      #2

      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. =========================================================

      R J P 3 Replies Last reply
      0
      • T Tim Carmichael

        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.

        P Online
        P Online
        PIEBALDconsult
        wrote on last edited by
        #3

        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 as 12/1/2013 (whatever the current year is). :omg: So then my ETL process has to detect these and correct them.

        1 Reply Last reply
        0
        • T Tim Carmichael

          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 Offline
          I Offline
          Ian Shlasko
          wrote on last edited by
          #4

          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)

          Richard DeemingR 1 Reply Last reply
          0
          • I Ian Shlasko

            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)

            Richard DeemingR Offline
            Richard DeemingR Offline
            Richard Deeming
            wrote on last edited by
            #5

            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

            "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

            1 Reply Last reply
            0
            • C Chris Quinn

              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. =========================================================

              R Offline
              R Offline
              Rob Grainger
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • C Chris Quinn

                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. =========================================================

                J Offline
                J Offline
                Jorgen Andersson
                wrote on last edited by
                #7

                It's even documented here[^].

                Wrong is evil and must be defeated. - Jeff Ello

                1 Reply Last reply
                0
                • C Chris Quinn

                  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. =========================================================

                  P Offline
                  P Offline
                  peterchen
                  wrote on last edited by
                  #8

                  The sad thing is I immediately knew when I saw the subject and the dates.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups