Google

Learn Excel from MrExcel Video Podcast

EXCEL FUNCTIONS

Excel Programming

Excel Charting

Excel VBA

Friday, February 16, 2007

Tips on entering dates and times

Dates and times are numbers Microsoft Excel treats dates and times as numbers. The way that a time or date is displayed on a worksheet depends on the number format applied to the cell. When you type a date or time that Excel recognizes, the cell's format changes from the General number format to a built-in date or time format. By default, dates and times are right-aligned in a cell. If Excel cannot recognize the date or time format, the date or time is entered as text, which is left-aligned in the cell.

Control Panel Options you select in the Regional Settings of Control Panel determine the default format for the current date and time and the characters recognized as date and time separators — for example, the slash (/) and dash (-) for dates and the colon (:) for times on United States-based systems.

Use a 4-digit year When entering dates such as Decemeber 01, Excel matches the day first and then the year. For instance, December 01 is entered as December 1 of the present year, not as December of the year 2001.

Entering dates and times together To type a date and time in the same cell, separate the date and time with a space.

The 12-hour or 24-hour clock To type a time based on the 12-hour clock, type a space followed by AM or PM (or A or P) after the time. Otherwise, Excel bases the time on the 24-hour clock. For example, if you type 3:00 instead of 3:00 PM, the time is stored as 3:00 AM.

Viewing the serial number behind a date or time Regardless of the format used to display a date or time, Excel stores all dates as serial numbers and stores all times as decimal fractions. To display a date as a serial number or display a time as a fraction, select the cells that contain the date or time. On the Format menu, click Cells, click the Number tab, and then click General in the Category box.

Calculating with dates and times Times and dates can be added, subtracted, and included in other calculations. To use a date or time in a formula, enter the date or time as text enclosed in quotation marks. For example, the following formula would display a difference of 68:

="5/12/2004"-"3/5/2004"

The 1904 date system In Excel for Windows (and Lotus 1-2-3), days are numbered from the beginning of the century; the date serial number 1 corresponds to the date January 1, 1900. Excel for the Macintosh uses the 1904 date system; the date serial number 1 corresponds to January 2, 1904. To change the date system for use in calculations, click Options on the Tools menu, and then click the Calculation tab. Under Workbook options, select the 1904 date system check box. Use the 1904 date system for a workbook if you use that workbook with other workbooks that use the 1904 date system.

If you open in Excel for Windows a file created in Excel version 2.0 or later for the Macintosh, Excel recognizes the file format and automatically changes dates to the 1900 date system. Similarly, if you open an Excel for Windows file on a Macintosh, Excel changes dates to the 1904 date system.

No comments: