How to enter dates
First open the spreadsheet (click the button) and enter a heading in the column that will contain the dates.
Next click the Format spreadsheet button .
On the Column tab, select the "Date" option for "Format" and increase the column width to e.g. 12 so there is enough space to enter dates. If you do not specify "Date" for "Format", MedCalc will display the number 0.0127551 when you enter a date as 5/7/56 (5 divided by 7 divided by 56).
Now you can start entering the dates. MedCalc allows entering dates using a slash or dot or any non-numerical character as a separator: e.g. 01/05/1961 (date format DD.MM.YY).
Default century
When you enter a date in the spreadsheet with a year less than 100, MedCalc will interpret this year as a year in the default century (1900 or 2000) which can be selected in the Options panel (spreadsheet tab). For example when the default century is 2000 and you enter the date 02.12.19, this will be converted to 02.12.2019. So when you want to enter a date situated in another century than the default century (see Options), enter the year using 4 digits.
How MedCalc stores dates and times
MedCalc stores a date and time as a number ddddd.tttttt with the integer portion ddddd representing the number of days since 1801-Jan−1, plus a fractional portion of a 24 hour day tttttt. The number ddddd.tttttt is called a serial date, or serial date-time number.
The date format, i.e. the way the serial date number is converted to a string, can be chosen in the Regional settings dialog box of the Control box window that is part of the Windows operating system (see your Windows documentation).
Serial date numbers can be used for comparison, sorting, arithmetic operations and statistical analysis.
For example:
Note: both columns A and B have been formatted as Date, see above.
Dates
The integer portion of the serial date-time number, ddddd, represents the number of days since 1801-Jan−1, with 1801-Jan−1 begin the first day. For example, the date 5-Jul-2011 is stored as 76887.
- Date strings, for example "5.12.72" or "5.7.1956" can be converted to serial date numbers using the DATEVALUE function (see Date & time functions).
- A serial date number can be back-transformed to a date string using the DATE function.
Times
The fractional portion of the serial date-time number, tttttt, represents the fractional portion of a 24 hour day. For example, 6:00 AM is stored as 0.25, or 25% of a 24 hour day. Similarly, 6PM is stored at 0.75, or 75% percent of a 24 hour day.
- Time strings, for example "14:30" can be converted to serial time numbers using the TIMEVALUE function.
- A serial time number can be back-transformed to a time string using the TIME function.