# 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).

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

When you enter a date in the spreadsheet with a year less than 100, MedCalc will interpret this year as a year in the 20^{th} century: 20.12.88 = 20.12.1988. When you enter 0 as the year number, MedCalc will interpret this as the year 1900: 20.12.00 = 20.12.1900. So when you want to enter a date situated in the 19^{th} or 21^{st} century, enter the year using 4 digits.

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