Anda di halaman 1dari 30

Date and Time Functions

DATE(year,month,day) --- Returns the serial number that represents a particular date.

Year The year argument can be one to four digits. Excel interprets the year argumen
the date system you are using. By default, Excel for W
For the 1900 date system:
If year is between 0 (zero) and 1899 (inclusive), Excel adds that value to 1900 to calculate the year.
For example, DATE(100,1,2) returns January 2, 2000 (1900+100).
If year is between 1900 and 9999 (inclusive), Excel uses that value as the year.
For example, DATE(2000,1,2) returns January 2, 2000.
If year is less than 0 or is 10000 or greater, Excel returns the #NUM! error value.
For the 1904 date system:
If year is between 4 and 1899 (inclusive), Excel adds that value to 1900 to calculate the year.
For example, DATE(100,1,2) returns January 2, 2000 (1900+100).
If year is between 1904 and 9999 (inclusive), Excel uses that value as the year.
For example, DATE(2000,1,2) returns January 2, 2000.
If year is less than 4 or is 10000 or greater or if year is between 1900 and 1903 (inclusive),
Excel returns the #NUM! error value.
Month is a number representing the month of the year. If month is greater than 12,
month adds that number of months to the first month in the year specified.
For example, DATE(1998,14,2) returns the serial number representing February

Day is a number representing the day of the month. If day is greater than the numbe
in the month specified, day adds that number of days to the first day in the month.
For example, DATE(1998,1,35) returns the serial number representing February

EDATE(start_date,months) --- Returns the serial number that represents the date that is the indicated number of

months before or after a specified date (the start_date


dates or due dates that fall on the same day of the mo
information about how Microsoft Excel uses serial nu
4/20/2015 Start_date is a date that represents the start date. Dates may be entered as text str

quotation marks (for example, "1/30/1998" or "1998/01/30"),


which represents January 30, 1998, if you're using the 1900

formulas or functions (for example, DATEVALUE("1/3

Months is the number of months before or after start_date. A positive value for mon
yields a future date; a negative value yields a past dat
If start_date is not a valid date, EDATE returns the #NUM! error value.
If months is not an integer, it is truncated.

DATEVALUE(date_text) --- Returns the serial number of the date represented by date_text. Use DATEVALUE to convert a date

Date_text is text that represents a date in an Excel date format. For example, "1/30
30-Jan-1998 are text strings within quotation marks th

42081

system in Excel for Windows, date_text must represen


December 31, 9999. Using the default date system in
represent a date from January 1, 1904, to December
#VALUE! error value if date_text is out of this range.
If the year portion of date_text is omitted, DATEVALUE

DATEDIF(start_date,end_date,unit) --- Calculates the number of days, months, or years between two dates.

Start_date is a date that represents the first, or starting, date of the period. Dates m
as text strings within quotation marks (for example, "2
31
(for example, 36921, which represents January 30, 20
22
or as the results of other formulas or functions (for exa
End_date is a date that represents the last, or ending, date of the period.
Unit is the type of information you want returned.

DAY(serial_number) --- Returns the day of a date, represented by a serial number. The day is given as an integer ranging from

Serial_number is the date of the day you are trying to find. Dates may be entered as text strings within quotati
marks (for example, "1/30/1998" or "1998/01/30"), as serial numbers (for exam
which represents January 30, 1998, if you're using the 1900 date system), or a
formulas or functions (for example, DATEVALUE("1/30/1998")).
18

NETWORKDAYS(start_date,end_date,holidays) --- Returns the number of whole working days between start_date

10 Start_date is a date that represents the start date. Dates may be entered as text str
within quotation marks (for example, "1/30/1998" or "1
(for example, 35825, which represents January 30, 19
system), or as results of other formulas or functions (f
End_date is a date that represents the end date.
Holidays is an optional range of one or more dates to exclude from the working cale
as state and federal holidays and floating holidays. T
that contain the dates or an array constant of the seria
NOW( ) --- Returns the serial number of the current date and time.
8/28/2015 14:19

TODAY( ) --- Returns the serial number of the current date. The serial number is the
date-time code used by Microsoft Excel for date and time calculations.
8/28/2015

MONTH(serial_number) --- Returns the month of a date represented by a serial number.

The month is given as an integer, ranging from 1 (January) to 12 (December).


Serial_number is the date of the month you are trying to find. Dates may be entered as text strings
within quotation marks (for example, "1/30/1998" or "1998/01/30"), as serial nu
3
(for example, 35825, which represents January 30, 1998, if you're using the 19
system), or as results of other formulas or functions (for example, DATEVALUE

EOMONTH(start_date,months) --- Returns the serial number for the last day of the month that is the indicated number of mon

Start_date is a date that represents the starting date. Dates may be entered as text
Months is the number of months before or after start_date. A positive value for mon

YEAR(serial_number) --- Returns the year corresponding to a date. The year is returned as an integer in the range 1900-9999

Serial_number is the date of the year you want to find. Dates may be entered as text strings
within quotation marks (for example, "1/30/1998" or "1998/01/30"), as serial nu
2015
(for example, 35825, which represents January 30, 1998, if you're using the 19
or as results of other formulas or functions (for example, DATEVALUE("1/30/19

TIME(hour,minute,second) --- Returns the decimal number for a particular time. The decimal number returned by TIME is
a value ranging from 0 to 0.99999999, representing th
(12:00:00 A.M.) to 23:59:59 (11:59:59 P.M.)..
Hour is a number from 0 (zero) to 23 representing the hour.
Minute is a number from 0 to 59 representing the minute.
Second is a number from 0 to 59 representing the second.

HOUR(serial_number) --- Returns the hour of a time value. The hour is given as an integer,
ranging from 0 (12:00 A.M.) to 23 (11:00 P.M.).

Serial_number is the time that contains the hour you want to find. Times may be entered as text strings within
quotation marks (for example, "6:45 PM"), as decimal numbers (for example, 0
represents 6:45 PM), or as results of other formulas or functions (for example,
TIMEVALUE("6:45 PM")).

MINUTE(serial_number) --- Returns the minutes of a time value. The minute is given as an integer, ranging from 0 to 59.

Serial_number is the time that contains the minute you want to find. Times may be
text strings within quotation marks (for example,
(for example, 0.78125, which represents 6:45 PM
or functions (for example, TIMEVALUE("6:45 PM

SECOND(serial_number) --- Returns the seconds of a time value. The second is given as an integer in the range 0 (zero) to 5

Serial_number is the time that contains the seconds you want to find. Times may b

DAYS360
Calculates the number of days between two dates based on a 360-day year
DAYS360(start_date,end_date,method)
METHOD:
start
1/28/2008
end
1/31/2008
Formula
Description
Number of days between the two dates above, based on a 360-day year

Using the method true

EDATE
Returns the serial number of the date that is the indicated number of months before or after the start date
EDATE(start_date,months)
1/15/2008
Formula
Description
The date, one month after the date above
The date, one month before the date above
The date, two months after the date above

TIMEVALUE Converts a time in the form of text to a serial number


TIMEVALUE(time_text)
Formula

Description
0.1 Decimal part of a day, for the time
0.2743055556 Decimal part of a day, for the time

WEEKDAY
Converts a serial number to a day of the week
WEEKDAY(serial_number,return_type)
5 Return_type
1-SUNDAY; 2- MONDAY; 3- 0 1 or omitted
Data
1/1/2008
2
Formula
Description
3
Day of the week, with numbers 1 (Sunday) through 7 (Saturday)
Day of the week, with numbers 1 (Monday) through 7 (Sunday)

Day of the week, with numbers 0 (Monday) through 6 (Sunday)

WEEKNUM
Converts a serial number to a number representing where the week falls numerically with a year
WEEKNUM(serial_num,return_type)
12 Serial_num
Data
1
9-Mar-08
2
Formula
Description
Number of the week in the year, with a week beginning on Sunday
Number of the week in the year, with a week beginning on Monday
Note March 9, 2008 is a Sunday.

WORKDAY
Returns the serial number of the date before or after a specified number of workdays
WORKDAY(start_date,days,holidays)
12/2/2008
Date
Description
6/1/2008 Start date
130 Days to completion
11/26/2008 Holiday
12/4/2008 Holiday
11/21/2008 Holiday
Formula
Description
Date 130 workdays from the start date 11/28/2008)
Date 130 workdays from the start date, excluding holidays

YEARFRAC Returns the year fraction representing the number of whole days between start_date and end_date
YEARFRAC(start_date,end_date,basis)
Data
Description
1/1/2008 Start date
7/30/2008 End date
2 Actual/360
Formula
Description (Result)
0.5861111111 Fraction of the year between the two dates
211/360

0.25 ONE FOURTH OF THE YEAR

rticular date.

e one to four digits. Excel interprets the year argument according to


he date system you are using. By default, Excel for Windows uses the 1900 date system.

dds that value to 1900 to calculate the year.


0 (1900+100).
s that value as the year.

s the #NUM! error value.

at value to 1900 to calculate the year.


0 (1900+100).
s that value as the year.

between 1900 and 1903 (inclusive),

g the month of the year. If month is greater than 12,


nths to the first month in the year specified.
4,2) returns the serial number representing February 2, 1999.

he day of the month. If day is greater than the number of days


ds that number of days to the first day in the month.
35) returns the serial number representing February 4, 1998.

the date that is the indicated number of

months before or after a specified date (the start_date). Use EDATE to calculate maturity
ates or due dates that fall on the same day of the month as the date of issue. For more
nformation about how Microsoft Excel uses serial numbers for dates, see the Remarks section.
sents the start date. Dates may be entered as text strings within

uotation marks (for example, "1/30/1998" or "1998/01/30"), as serial numbers (for example, 35825,
hich represents January 30, 1998, if you're using the 1900 date system), or as results of other

ormulas or functions (for example, DATEVALUE("1/30/1998")).

hs before or after start_date. A positive value for months


ields a future date; a negative value yields a past date.

te, EDATE returns the #NUM! error value.


is truncated.

nted by date_text. Use DATEVALUE to convert a date represented by text to a serial number.

s a date in an Excel date format. For example, "1/30/1998" or


0-Jan-1998 are text strings within quotation marks that represent dates. Using the default date

ystem in Excel for Windows, date_text must represent a date from January 1, 1900, to
December 31, 9999. Using the default date system in Excel for the Macintosh, date_text must
epresent a date from January 1, 1904, to December 31, 9999. DATEVALUE returns the
#VALUE! error value if date_text is out of this range.

s omitted, DATEVALUE uses the current year from your computer's built-in clock. Time information in date_text is ignored.

nths, or years between two dates.


This function is provided for compatibility.
sents the first, or starting, date of the period. Dates may be entered .
s text strings within quotation marks (for example, "2001/1/30"), as serial numbers
or example, 36921, which represents January 30, 2001, if you're using the 1900 date system),
r as the results of other formulas or functions (for example, DATEVALUE("2001/1/30")).
ents the last, or ending, date of the period.
ou want returned.("Y", "M", "D", "MD", "YM", "YD")

number. The day is given as an integer ranging from 1 to 31.

d. Dates may be entered as text strings within quotation


1998" or "1998/01/30"), as serial numbers (for example, 35825,
30, 1998, if you're using the 1900 date system), or as results of other
example, DATEVALUE("1/30/1998")).

of whole working days between start_date


and end_date. Working days exclude weekends and any dates
identified in holidays. Use NETWORKDAYS to calculate employee benefits
that accrue based on the number of days worked during a specific term.
sents the start date. Dates may be entered as text strings
within quotation marks (for example, "1/30/1998" or "1998/01/30"), as serial numbers
or example, 35825, which represents January 30, 1998, if you're using the 1900 date
ystem), or as results of other formulas or functions (for example, DATEVALUE("1/30/1998")).
ents the end date.
of one or more dates to exclude from the working calendar, such
as state and federal holidays and floating holidays. The list can be either a range of cells
hat contain the dates or an array constant of the serial numbers that represent the dates.

calculations.

serial number.

nteger, ranging from 1 (January) to 12 (December).


find. Dates may be entered as text strings
example, "1/30/1998" or "1998/01/30"), as serial numbers
h represents January 30, 1998, if you're using the 1900 date
ther formulas or functions (for example, DATEVALUE("1/30/1998")).

day of the month that is the indicated number of months before or after start_date. Use EOMONTH to calculate maturity dates or due dates

sents the starting date. Dates may be entered as text strings within quotation marks (for example, "1/30/1998" or "1998/01/30"), as serial nu
hs before or after start_date. A positive value for months yields a future date; a negative value yields a past date.
5/31/2015

ear is returned as an integer in the range 1900-9999.

ates may be entered as text strings


example, "1/30/1998" or "1998/01/30"), as serial numbers
h represents January 30, 1998, if you're using the 1900 date system),
ulas or functions (for example, DATEVALUE("1/30/1998")).

ar time. The decimal number returned by TIME is


value ranging from 0 to 0.99999999, representing the times from 0:00:00
12:00:00 A.M.) to 23:59:59 (11:59:59 P.M.)..

ven as an integer,
to 23 (11:00 P.M.).

nt to find. Times may be entered as text strings within


ple, "6:45 PM"), as decimal numbers (for example, 0.78125, which
s results of other formulas or functions (for example,
IMEVALUE("6:45 PM")).

ute is given as an integer, ranging from 0 to 59.


contains the minute you want to find. Times may be entered as
text strings within quotation marks (for example, "6:45 PM"), as decimal numbers
(for example, 0.78125, which represents 6:45 PM), or as results of other formulas
or functions (for example, TIMEVALUE("6:45 PM")).

cond is given as an integer in the range 0 (zero) to 59.


contains the seconds you want to find. Times may be
entered as text strings within quotation marks (for example, "6:45 PM"), as
decimal numbers (for example, 0.78125, which represents 6:45 PM), or as
results of other formulas or functions (for example, TIMEVALUE("6:45 PM")).

d on a 360-day year
FALSE or omitted: IF THE STARTING DATE IS 31 THEN IT WILL MOVED IT TO THE 30.
TRUE: IT WILL MOVE BACK OR FORWARD

U.S. (NASD) method. If the start


European method. Starting date
12

mber of months before or after the start date

Number returned
Numbers 1 (Sunday) through 7 (Saturday). Behaves like previous versions of Microsoft Excel.

Numbers 1 (Monday) through 7 (Sunday).


Numbers 0 (Monday) through 6 (Sunday).

alls numerically with a year

Week Begins
Week begins on Sunday. Weekdays are numbered 1 through 7.
Week begins on Monday. Weekdays are numbered 1 through 7.

ed number of workdays

ays between start_date and end_date

ONE FOURTH OF THE YEAR

Basis Day count basis


0 or omitted US (NASD) 30/360
1
Actual/actual
2
Actual/360
3
Actual/365
4
European 30/360

42081.00
1.00
2.00

1/18/2015

_text is ignored.

ulate maturity dates or due dates that fall on the last day of the month.

98" or "1998/01/30"), as serial numbers (for example, 35825, which represents January 30, 1998, if you're using the 1900 date system), or a

U.S. (NASD) method. If the starting date is the 31st of a month, it becomes equal to the 30th of the same month. If the ending date is the 3
European method. Starting dates and ending dates that occur on the 31st of a month become equal to the 30th of the same month.
5
11

Day count basis


US (NASD) 30/360
Actual/actual
Actual/360
Actual/365
European 30/360

he 1900 date system), or as results of other formulas or functions (for example, DATEVALUE("1/30/1998")).

. If the ending date is the 31st of a month and the starting date is earlier than the 30th of a month, the ending date becomes equal to the 1s
of the same month.

ate becomes equal to the 1st of the next month; otherwise the ending date becomes equal to the 30th of the same month.

Anda mungkin juga menyukai