Date and time functionsTo format a spreadsheet column for date, time or date-time input, see How to enter dates. DATEVALUE String to serial date numberThe function DATEVALUE(str) returns the serial date number for the date expressed in the string str. DATEVALUE("10.12.88") returns 68645 if the date format is DD.MM.YY. DATE Serial date number to stringDATE(dnr) returns the date corresponding with the serial date number dnr expressed as a string. DATE(DATEVALUE(A1)+7) returns "6.9.96" when cell A1 contains the date string 30.8.96 or "30/8/96" (date format DD.MM.YY) DATEFRAC Fractional year-numberDATEFRAC(date) converts date into a fractional year-number. The integer part of this number is the year, and the decimal fraction ranges from 0.0 to 0.99..., representing the dates 01 Jan to 31 Dec. DATEFRAC("01.07.2000") returns 2000.5 DAY Day functionDAY(date) returns the day of the month of date. Date can either be a serial date number or a date string. DAY("23.08.88") returns 23 (date format DD.MM.YY) DAYNAME Day name functionDAYNAME(date) returns the name of the day of date. Date can either be a serial date number or a date string. DAYNAME("03.12.2001") returns "Monday" (date format DD.MM.YY) MONTH Month functionMONTH(date) returns the month of the year of date. Date can either be a serial date number or a date string. MONTH("23.08.88") returns 8 (date format DD.MM.YY) MONTHNAME Month name functionMONTHNAME(date) returns the name of the month of date. Date can either be a serial date number or a date string. MONTHNAME("03.12.2001") returns "December" (date format DD.MM.YY) TIMEVALUE String to serial time numberTIMEVALUE(str) converts a time string (in "hh:mm" format) to a serial time number. A serial time number is a number ranging from 0.00 to 1.00 representing the time 0:00 to 24:00.
TIMEVALUE("06:30") returns 0.27084 TIME Serial time number to stringTIME(tnr) converts the serial time number tnr to a time string (hh:mm). TIME(0.5) returns 12:00 TIMEFRAC Fractional time-numberTIMEFRAC(time) converts time into a fractional time-number. The integer part of this number is the hour, and the decimal fraction ranges from 0.0 to 0.99, representing the minutes 0:00 to 0:59. TIMEFRAC("12:30") returns 12.5 TODAY Today's dateThe function TODAY() takes no argument and returns today's date. Note that the value of this function is not fixed, so if you use this function in a file and you reload this file the next day, the function will return the new date. TODAY() returns 24.01.1998 if today is the 24th of January 1998 and the date format is DD.MM.YY. DATEVAL(TODAY()) returns the serial number of today's date. WEEKNUM Week number functionWEEKNUM(date) returns the number of the week of the year of date. Date can either be a serial date number or a date string.
WEEKNUM("01.01.98") returns 1 WEEKDAY Weekday number functionWEEKDAY(date) returns the weekday number of date. Days are numbered from Monday (=1) to Sunday (=7). WEEKDAY("05.07.56") returns 4, this is the 4th day of the week (=Thursday). YEAR Year functionYEAR(date) returns the year of date. Date can either be a serial date number or a date string.
YEAR("23.08.88") returns 88 (date format DD.MM.YY) See also |