Why does Excel get another result than PowerShell and Google when trying to find out how many days have passed since 01.01.1900?

The why:

First of all, your friend and Google are calculating differently. Excel (using the 1900 Date system) only thinks there is one extra day since 1900.

Excel stores dates as serial numbers where 1-Jan-1900 = 1 And 10-Feb-2020 --> 43871

So days since by Excel should be 43871 - 1 --> 43870

However, the Excel calculation is incorrect.

When Excel was introduced, Lotus123 was the leading spreadsheet program.

Lotus 123 had a bug wherein it thought the year 1900 was a leap year.

For compatibility in view of the competition, Excel included that bug. However, since 29-Feb-1900 is a non-existent date, other methods will show, properly, 43869 when subtracting the two dates.

By the way, Excel VBA also calculates the date difference correctly --> 43869


Microsoft Excel supports two different date systems. These systems are the 1900 date system and the 1904 date system

The 1900 Date System

In the 1900 date system, the first day that is supported is January 1, 1900. When you enter a date, the date is converted into a serial number that represents the number of elapsed days starting with 1 for January 1, 1900. For example, if you enter July 5, 1998, Excel converts the date to the serial number 35981. By default, Microsoft Excel for Windows uses the 1900 date system. The 1900 date system enables better compatibility between Excel and other spreadsheet programs, such as Lotus 1-2-3, that are designed to run under MS-DOS or Microsoft Windows.

The 1904 Date System

In the 1904 date system, the first day that is supported is January 1, 1904. When you enter a date, the date is converted into a serial number that represents the number of elapsed days since January 1, 1904, starting with 0 for January 1, 1904. For example, if you enter July 5, 1998, Excel converts the date to the serial number 34519. Because of the design of early Macintosh computers, dates before January 1, 1904, were not supported. This design was intended to prevent problems related to the fact that 1900 was not a leap year. In the past, Excel for Macintosh defaulted to using the 1904 date system for workbooks originating on a Macintosh. However, Excel for Macintosh now defaults to the 1900 date system and supports dates as early as January 1, 1900.

The Difference Between the Date Systems

Because the two date systems use different starting days, the same date is represented by different serial numbers in each date system. For example, July 5, 1998 can have two different serial numbers, as follows.

Date system          Serial number of July 5, 1998
1900 date system     35981
1904 date system     34519

Source: https://docs.microsoft.com/en-us/office/troubleshoot/excel/1900-and-1904-date-system