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

From Apache OpenOffice Wiki
Jump to: navigation, search
m
m
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{DISPLAYTITLE:CURRENT funtion}}
 +
{{Documentation/CalcFunc InformationTOC
 +
|ShowPrevNext=block
 +
|PrevPage=Documentation/How_Tos/Calc:_CELL_functions
 +
|NextPage=Documentation/How_Tos/Calc:_FORMULA_function
 +
}}__NOTOC__
  
 
== CURRENT ==
 
== CURRENT ==
Line 23: Line 28:
  
 
=== Further information: ===
 
=== Further information: ===
: This function is best used only in simple situations. A more complex example: <tt>'''1 + 2*CURRENT()'''</tt>  returns <tt>'''5'''</tt>, because although the <tt>'''1'''</tt> has been encountered as the formula is evaluated, it is ignored while the more important multiplication is performed. Thus <tt>'''CURRENT()'''</tt> in this case yields <tt>'''2'''</tt>, hence the result: <tt>'''1 + 2*2'''</tt> equals <tt>'''5'''</tt>. However the exact order of calculation in more complex cases should not be relied on.
+
: This function is best used only in simple situations. A more complex example: <tt>'''1 + 2*CURRENT()'''</tt>  returns <tt>'''5'''</tt>, because although the <tt>'''1'''</tt> has been encountered as the formula is evaluated, it is ignored because evaluating the multiplication has precedence. The formula's value upto <tt>'''CURRENT()'''</tt> equals  <tt>'''2'''</tt>. Thus, <tt>''' 2*CURRENT()'''</tt> yields <tt>'''4'''</tt>, with the result: <tt>'''1 + 4'''</tt> equals <tt>'''5'''</tt>. However, the exact order of calculation in more complex cases should not be relied on.
  
  
{{Documentation/SeeAlso|
+
{{SeeAlso|EN|
 
* [[Documentation/How_Tos/Calc: STYLE function|STYLE]]
 
* [[Documentation/How_Tos/Calc: STYLE function|STYLE]]
  

Latest revision as of 13:07, 31 January 2024

CURRENT

Returns the current (to date) result of evaluating the formula.


Syntax:

CURRENT()

This function returns the result to date of evaluating the formula of which it is a part (in other words the result as far as that evaluation has got). Its main use is together with the STYLE function to apply selected styles to a cell depending on the cell contents.


Example:

1 + 2 + CURRENT()

returns 6. The formula is calculated from left to right as: 1 + 2 equals 3, giving the result to date when CURRENT() is encountered; CURRENT() therefore yields 3, which is added to the original 3 to give 6.

A2 + B2 + STYLE(IF(CURRENT()>10; ”Red”; ”Default”))

returns A2 + B2   (STYLE returns 0 here). If this sum is greater than 10, the style Red is applied to the cell. See the STYLE function for more explanation.

"choo" & CURRENT()

returns choochoo.


Further information:

This function is best used only in simple situations. A more complex example: 1 + 2*CURRENT() returns 5, because although the 1 has been encountered as the formula is evaluated, it is ignored because evaluating the multiplication has precedence. The formula's value upto CURRENT() equals 2. Thus, 2*CURRENT() yields 4, with the result: 1 + 4 equals 5. However, the exact order of calculation in more complex cases should not be relied on.




See Also
Retrieved from "https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_CURRENT_function&oldid=259796"
Views
Personal tools
Navigation
Tools
In other languages