Difference between revisions of "Documentation/How Tos/Calc: DAYS function"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Issue 84884 resolved; problem with ODFF)
m
Line 3: Line 3:
 
== DAYS ==
 
== DAYS ==
 
Returns the number of days between two dates
 
Returns the number of days between two dates
 
  
 
=== Syntax: ===
 
=== Syntax: ===
Line 10: Line 9:
  
 
: <tt>'''DAYS'''</tt> returns <tt>'''enddate - startdate'''</tt>. The result may be negative.
 
: <tt>'''DAYS'''</tt> returns <tt>'''enddate - startdate'''</tt>. The result may be negative.
 
  
 
=== Example: ===
 
=== Example: ===
Line 18: Line 16:
 
<tt>'''DAYS(A1; A2)'''</tt>
 
<tt>'''DAYS(A1; A2)'''</tt>
 
: where cell A1 contains the date <tt>'''9Jun08'''</tt> and A2 contains <tt>'''2Jun08'''</tt> returns <tt>'''7'''</tt>.
 
: where cell A1 contains the date <tt>'''9Jun08'''</tt> and A2 contains <tt>'''2Jun08'''</tt> returns <tt>'''7'''</tt>.
 
  
 
=== See also: ===
 
=== See also: ===
Line 27: Line 24:
  
 
'''[[Documentation/How_Tos/Calc: Date & Time functions#Date and Time overview|Date & Time overview]]'''
 
'''[[Documentation/How_Tos/Calc: Date & Time functions#Date and Time overview|Date & Time overview]]'''
 
  
 
=== Issues: ===
 
=== Issues: ===
 
* Note that <tt>'''DAYS'''</tt> does not count the first day of the period, but  <tt>'''NETWORKDAYS'''</tt> does.
 
* Note that <tt>'''DAYS'''</tt> does not count the first day of the period, but  <tt>'''NETWORKDAYS'''</tt> does.

Revision as of 09:58, 16 January 2008


DAYS

Returns the number of days between two dates

Syntax:

DAYS(enddate; startdate)

startdate and enddate may be dates as numbers or text (which is converted to number form).
DAYS returns enddate - startdate. The result may be negative.

Example:

DAYS("3Mar08"; "1Mar08")

returns 2.

DAYS(A1; A2)

where cell A1 contains the date 9Jun08 and A2 contains 2Jun08 returns 7.

See also:

DAYS360, NETWORKDAYS

Date & Time functions

Date & Time overview

Issues:

  • Note that DAYS does not count the first day of the period, but NETWORKDAYS does.
Personal tools