Excel Date system

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,834
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
My worksheet contains two dates.

Cell A1 is 21/01/1900
Cell A2 is 11/01/1900

The "Use 1904 data system" box (found under File -> More -> Options -> Advanced) is UNCHECKED.

When I inspect this code in the Locals window:

Code:
    Dim DataArray() As Variant
  
    DataArray() = Sheet1.Cells(1, 1).CurrentRegion.Value

why does DataArray(1,1) contain the value:

Code:
#20/01/1900#

and DataArray(2,1) contains:

Code:
#10/01/1900#

I expected to see:

Code:
#21/01/1900#

and

#11/01/1900#

Thanks
 
Last edited:

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
It's due to Lotus 123 thinking 1900 was a leap year, so Excel replicated that. VBA on the other hand didn't, so 1 in VBA's date system is 31/12/1899 whereas in Excel it's 1/1/1900. The two sync back up on 1st March 1900.
 
Upvote 0
Solution
It's due to Lotus 123 thinking 1900 was a leap year, so Excel replicated that. VBA on the other hand didn't, so 1 in VBA's date system is 31/12/1899 whereas in Excel it's 1/1/1900. The two sync back up on 1st March 1900.
Thanks.
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,816
Members
449,469
Latest member
Kingwi11y

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top