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

From Apache OpenOffice Wiki
Jump to: navigation, search
m
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{DISPLAYTITLE: DAYS function}}
 +
{{Documentation/CalcFunc DateTimeTOC
 +
|ShowPrevNext=block
 +
|PrevPage=Documentation/How_Tos/Calc:_NETWORKDAYS_function
 +
|NextPage=Documentation/How_Tos/Calc:_DAYS360_function
 +
}}__NOTOC__
  
 
== DAYS ==
 
== DAYS ==
Line 16: Line 21:
 
<tt>'''DAYS(A1; A2)'''</tt>
 
<tt>'''DAYS(A1; A2)'''</tt>
 
: where cell A1 contains the date <tt>'''2008-06-09'''</tt> and A2 contains <tt>'''2008-06-02'''</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: ===
 
'''[[Documentation/How_Tos/Calc: DAYS360 function|DAYS360]]''',
 
'''[[Documentation/How_Tos/Calc: NETWORKDAYS function|NETWORKDAYS]]''',
 
'''[[Documentation/How_Tos/Calc: WEEKS function|WEEKS]]''',
 
'''[[Documentation/How_Tos/Calc: MONTHS function|MONTHS]]''',
 
'''[[Documentation/How_Tos/Calc: YEARS function|YEARS]]'''
 
 
'''[[Documentation/How_Tos/Calc: Date & Time functions|Date & Time functions]]'''
 
 
'''[[Documentation/How_Tos/Calc: Date & Time functions#Date and Time overview|Date & Time overview]]'''
 
  
 
=== Issues: ===
 
=== Issues: ===
Line 32: Line 26:
 
* <tt>'''DAYS'''</tt> is not portable to Excel.
 
* <tt>'''DAYS'''</tt> is not portable to Excel.
 
* <tt>'''DAYS'''</tt> really does return <tt>'''enddate - startdate'''</tt>; thus if either date has a time component (for example "2008-01-03T15:15"), the number of days returned may not be integer. To ensure an integer result, consider <tt>'''INT(DAYS())'''</tt>.
 
* <tt>'''DAYS'''</tt> really does return <tt>'''enddate - startdate'''</tt>; thus if either date has a time component (for example "2008-01-03T15:15"), the number of days returned may not be integer. To ensure an integer result, consider <tt>'''INT(DAYS())'''</tt>.
 +
 +
{{SeeAlso|EN|
 +
* [[Documentation/How_Tos/Calc: DAYS360 function|DAYS360]]
 +
* [[Documentation/How_Tos/Calc: NETWORKDAYS function|NETWORKDAYS]]
 +
* [[Documentation/How_Tos/Calc: WEEKS function|WEEKS]]
 +
* [[Documentation/How_Tos/Calc: MONTHS function|MONTHS]]
 +
* [[Documentation/How_Tos/Calc: YEARS function|YEARS]]
 +
 +
* [[Documentation/How_Tos/Calc: Date & Time functions#Date and Time overview|Date & Time overview]]
 +
 +
* [[Documentation/How_Tos/Calc: Date & Time functions|Date & Time functions]]
 +
 +
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 +
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 +
[[Category: Documentation/Reference/Calc/Date and Time functions]]

Latest revision as of 13:58, 30 January 2024



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.

Issues:

  • Note that DAYS does not count the first day of the period, but NETWORKDAYS does.
  • DAYS is not portable to Excel.
  • DAYS really does return enddate - startdate; thus if either date has a time component (for example "2008-01-03T15:15"), the number of days returned may not be integer. To ensure an integer result, consider INT(DAYS()).



See Also
Retrieved from "https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_DAYS_function&oldid=259701"
Views
Personal tools
Navigation
Print/export
Tools