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

From Apache OpenOffice Wiki
Jump to: navigation, search
m
m (Example:: ISO date)
Line 11: Line 11:
  
 
=== Example: ===
 
=== Example: ===
<tt>'''DAYS("3Mar08"; "1Mar08")'''</tt>
+
<tt>'''DAYS("2008-03-03"; "2008-03-01")'''</tt>
: returns <tt>'''2'''</tt>.
+
: returns <tt>'''2'''</tt>, the number of days between 1March08 and 3March08.
  
 
<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>'''2008-06-09'''</tt> and A2 contains <tt>'''2008-06-02'''</tt> returns <tt>'''7'''</tt>.
  
 
=== See also: ===
 
=== See also: ===

Revision as of 07:39, 15 February 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("2008-03-03"; "2008-03-01")

returns 2, the number of days between 1March08 and 3March08.

DAYS(A1; A2)

where cell A1 contains the date 2008-06-09 and A2 contains 2008-06-02 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