Date and time functions
These functions perform calculations on date, time, or numeric expressions. Their arguments must be specified as serial numbers. The part of the number to the left of the decimal point represents the number of days since January 1, 1904 (that date being 0). The part of the number to the right of the decimal point represents the time of day. Negative numbers represent days before January 1, 1904. Results of date and time functions are serial numbers that can be reformatted in spreadsheets with the Number command (Format menu), or in databases with the Field Info command (Edit menu).
Calculates a serial number for the specified date. Format: =DATE(year,month,day) Arguments: Example: =DATE(2000,10,4) returns 35341, the serial number for October 4, 2000. Calculates a date from the supplied serial number and format. Format: =DATETOTEXT(serial number,format number) Arguments:
Example: =DATETOTEXT(35341,1) returns Oct 4, 2000. Converts a serial number to a number for the day of the month. Format: =DAY(serial number) Argument: Example: =DAY(35341) returns 4. The serial number 35341 represents the 4th day of October. Converts a number to the name of the day of the week. Format: =DAYNAME(number) Argument: Example: =DAYNAME(6) returns Friday. Converts a serial number to the day of the year. Format: =DAYOFYEAR(serial number) Argument: Example: =DAYOFYEAR(35341) returns 278. The serial number 35341 represents October 4, the 278th day of the year 2000. Converts the time portion of a serial number to the number of the hour (in the range 0-23). Format: =HOUR(serial number) Argument: Example: =HOUR(0.5660) returns 13. The serial number 0.5660 represents the thirteenth hour, or 1:00 P.M. Calculates minutes for a serial number. Format: =MINUTE(serial number) Argument: Example: =MINUTE(0.5660) returns 35. The serial number 0.5660 represents the thirteenth hour and the thirty-fifth minute, or 1:35 P.M. Converts a serial number to the number of the corresponding month. Format: =MONTH(serial number) Argument: Example: =MONTH(35341) returns 10. The serial number 35341 represents October 4, the tenth month of the year 2000. Calculates the name of a month from its number. Format: =MONTHNAME(number) Argument: Example: =MONTHNAME(10) returns October. =MONTHNAME(MONTH(35341)) returns October. When a spreadsheet is recalculated, this function displays the current date or time, or the serial number of the current date and time (based on the computer's clock). Format: =NOW() Argument: No argument Example: If the function was last executed on October 4, 1999, =NOW() returns October 4, 1999 if the cell was formatted as a date or 34975 (the corresponding serial number) if the cell was formatted as a number. Calculates seconds for a serial number. Format: =SECOND(serial number) Argument: Example: =SECOND(0.5664) returns 37. The serial number 0.5664 represents1:35:37 P.M. Converts a date written in text to its serial number. Format: =TEXTTODATE(date text) Argument: Example: =TEXTTODATE("10/4/00") returns 35341. Converts a time written in text to its serial number. Format: =TEXTTOTIME(time text) Argument: Example: =TEXTTOTIME("13:30") returns 0.5625, the serial number for the time 13:30 (using a 24-hour clock). Converts a specified time (based on a 24-hour clock) into a serial number. Format: =TIME(hour,minute,second) Arguments: Example: =TIME(12,0,0) returns 0.5 (12 noon is halfway through the day). Converts a time serial number to text. Format: =TIMETOTEXT(serial number,format) Arguments:
Example: =TIMETOTEXT(0.75,3) returns 18:00:00. Converts a serial number to a number for the day of the week (Sunday=1, Monday=2, and so on). Format: =WEEKDAY(serial number) Argument: Example: =WEEKDAY(35341) returns 4. The serial number 35341 represents October 4, 2000, which falls on a Wednesday. Converts a serial number to the number for the week in the year (from 1 to 52). Format: =WEEKOFYEAR(serial number) Argument: Example: =WEEKOFYEAR(35341) returns 41. The serial number 35341 represents October 4, the forty-first week of the year 2000. Calculates the year for a serial number. Format: =YEAR(serial number) Argument: Example: =YEAR(35341) returns 2000. The serial number 35341 represents October 4, 2000. Related topic
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Table of contents | Index |