diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:54:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 05:54:39 +0000 |
commit | 267c6f2ac71f92999e969232431ba04678e7437e (patch) | |
tree | 358c9467650e1d0a1d7227a21dac2e3d08b622b2 /helpcontent2/source/text/scalc/01/04060199.xhp | |
parent | Initial commit. (diff) | |
download | libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip |
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'helpcontent2/source/text/scalc/01/04060199.xhp')
-rw-r--r-- | helpcontent2/source/text/scalc/01/04060199.xhp | 413 |
1 files changed, 413 insertions, 0 deletions
diff --git a/helpcontent2/source/text/scalc/01/04060199.xhp b/helpcontent2/source/text/scalc/01/04060199.xhp new file mode 100644 index 0000000000..0fbf698e12 --- /dev/null +++ b/helpcontent2/source/text/scalc/01/04060199.xhp @@ -0,0 +1,413 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + --> +<helpdocument version="1.0"> +<meta> +<topic id="textscalc0104060199xml" indexer="include" status="PUBLISH"> +<title id="tit">Operators in $[officename] Calc</title> +<filename>/text/scalc/01/04060199.xhp</filename> +</topic> +</meta> +<body> +<bookmark branch="index" id="bm_id3156445"> +<bookmark_value>operators; in spreadsheet formulas</bookmark_value> +<bookmark_value>formulas; operators</bookmark_value> +<bookmark_value>operators; formula functions</bookmark_value> +</bookmark><comment>mw added 7 new index entries</comment> +<h1 id="hd_id3156445">Operators in $[officename] Calc</h1> +<paragraph role="paragraph" id="par_id3155812">You can use the following operators in $[officename] Calc:</paragraph> +<bookmark branch="index" id="bm_id891687563561282"> +<bookmark_value>arithmetical operators</bookmark_value> +<bookmark_value>division sign, see also operators</bookmark_value> +<bookmark_value>multiplication sign, see also operators</bookmark_value> +<bookmark_value>minus sign, see also operators</bookmark_value> +<bookmark_value>plus sign, see also operators</bookmark_value> +</bookmark> +<h2 id="hd_id3153066">Arithmetical Operators</h2> +<paragraph role="paragraph" id="par_id3148601">These operators return numerical results.</paragraph> +<table id="tbl_id3151240"> +<tablerow> +<tablecell> +<paragraph role="tablehead" id="par_id3144768">Operator</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablehead" id="par_id3157982">Name</paragraph> +</tablecell> +<tablecell> + <paragraph role="tablehead" id="par_id401599494815994">Example</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> + <paragraph role="tablecontent" localize="false" id="par_id3149126">+</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3150892">Addition</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3153247" localize="false">1+1</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> + <paragraph role="tablecontent" localize="false" id="par_id3159204">-</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3145362">Subtraction</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3153554" localize="false">2-1</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> + <paragraph role="tablecontent" localize="false" id="par_id3153808">-</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3151193">Negation</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3154712" localize="false">-5</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> + <paragraph role="tablecontent" localize="false" id="par_id3149873">*</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3147504">Multiplication</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3149055" localize="false">2*2</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> + <paragraph role="tablecontent" localize="false" id="par_id3151341">/</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3159260">Division</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3153027" localize="false">9/3</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> + <paragraph role="tablecontent" localize="false" id="par_id3156396">%</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3150372">Percent</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3145632" localize="false">15%</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> + <paragraph role="tablecontent" localize="false" id="par_id3149722">^</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3159127">Exponentiation</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3157873" localize="false">3^2</paragraph> +</tablecell> +</tablerow> +</table> + +<note id="par_id881623862728559">Prefix "-" (negation) has a higher precedence than "^" (exponentiation). For example -3^2 equals 9, which is the square of a negative number.</note> + +<bookmark branch="index" id="bm_id481687564343986"> +<bookmark_value>operators;comparison</bookmark_value> +<bookmark_value>comparisons;operators in Calc</bookmark_value> +</bookmark> +<h2 id="hd_id3152981">Comparative operators</h2> +<paragraph role="paragraph" id="par_id3157902">These operators return either true or false.</paragraph> +<table id="tbl_id3148725"> +<tablerow> +<tablecell> +<paragraph role="tablehead" id="par_id3149889">Operator</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablehead" id="par_id3150743">Name</paragraph> +</tablecell> +<tablecell> + <paragraph role="tablehead" id="par_id201599495083374">Example</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> +<paragraph role="tablecontent" localize="false" id="par_id3148888">=</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3154845">Equal</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3154546" localize="false">A1=B1</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> + <paragraph role="tablecontent" localize="false" id="par_id3154807">></paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3148580">Greater than</paragraph> +</tablecell> +<tablecell> + <paragraph role="tablecontent" id="par_id3145138" localize="false">A1>B1</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> +<paragraph role="tablecontent" localize="false" id="par_id3149507"><</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3150145">Less than</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3150901" localize="false">A1<B1</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> + <paragraph role="tablecontent" localize="false" id="par_id3153078">>=</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3150866">Greater than or equal to</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3153111" localize="false">A1>=B1</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> + <paragraph role="tablecontent" localize="false" id="par_id3153004"><=</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3150335">Less than or equal to</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3148760" localize="false">A1<=B1</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> + <paragraph role="tablecontent" localize="false" id="par_id3157994"><></paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3150019">Inequality</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3149878" localize="false">A1<>B1</paragraph> +</tablecell> +</tablerow> +</table> +<bookmark branch="index" id="bm_id3157975"> +<bookmark_value>text operators</bookmark_value> +<bookmark_value>text concatenation</bookmark_value> +</bookmark> +<h2 id="hd_id3145241">Text operators</h2> +<paragraph role="paragraph" id="par_id3155438">The operator combines separate texts into one text.</paragraph> +<table id="tbl_id3156061"> +<tablerow> +<tablecell> +<paragraph role="tablehead" id="par_id3150566">Operator</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablehead" id="par_id3153048">Name</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablehead" id="par_id201599494708332">Example</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> + <paragraph role="tablecontent" localize="false" id="par_id3148769">&</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3157975">text concatenation</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3157993">"Sun" & "day" is "Sunday"</paragraph> +</tablecell> +</tablerow> +</table> +<bookmark branch="index" id="bm_id291687563892759"> +<bookmark_value>reference operators</bookmark_value> +<bookmark_value>intersection reference operator</bookmark_value> +<bookmark_value>union reference operator</bookmark_value> +<bookmark_value>range operator</bookmark_value> +</bookmark> +<section id="referenceoperators"> +<h2 id="hd_id3153550">Reference operators</h2> +<paragraph role="paragraph" id="par_id3149024">These operators return a cell range of zero, one or more cells.</paragraph> +<paragraph role="paragraph" id="par_id2324900">Range has the highest precedence, then intersection, and then finally union.</paragraph> +<table id="tbl_id3154633"> +<tablerow> +<tablecell> +<paragraph role="tablehead" id="par_id3158416">Operator</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablehead" id="par_id3152822">Name</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablehead" id="par_id521599494740206">Example</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> +<paragraph role="tablecontent" localize="false" id="par_id3156257">:</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3153924">Range</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3148432">A1:C108, A:D or 3:13</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> +<paragraph role="tablecontent" localize="false" id="par_id3152592">!</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3150606">Intersection</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id3083445">SUM(A1:B6!B5:C12)</paragraph> +<paragraph role="tablecontent" id="par_id3150385">Calculates the sum of all cells in the intersection; in this example, the result yields the sum of cells B5 and B6.</paragraph> +</tablecell> +</tablerow> +<tablerow> +<tablecell> +<paragraph role="tablecontent" localize="false" id="par_id4003723">~</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id838953">Concatenation or union</paragraph> +</tablecell> +<tablecell> +<paragraph role="tablecontent" id="par_id2511978">Takes two references and returns a reference list, which is a concatenation of the left reference followed by the right reference. Double entries are referenced twice.</paragraph> +<paragraph role="paragraph" id="par_id961672071835372"><input>=COUNT(A1:B2~B2:C3)</input> counts values of A1:B2 and B2:C3. Note that the cell B2 is counted twice.</paragraph> +<paragraph role="paragraph" id="par_id401672243346224"><input>=INDEX(A1:B2~C1:D2;2;1;2)</input> selects cell C2, that is, the first cell of the second row, first column, of the second range (C1:D2) of the range list.</paragraph> +</tablecell> +</tablerow> +</table> +<note id="par_id181890">A reference list is not allowed inside an array expression.</note> +</section> +<bookmark xml-lang="en-US" branch="index" id="bm_id311687563684141"> + <bookmark_value>operators;precedence of</bookmark_value> +</bookmark> +<h2 id="hd_id981687562294437">Operator precedence</h2> +<paragraph role="paragraph" id="par_id271687562351999">Associativity and precedence of operators, from highest to lowest precedence.</paragraph> +<table id="tbl_precedence"> + <tablerow> + <tablecell><paragraph role="tablehead" id="par_id461687561515440">Associativity</paragraph> + </tablecell> + <tablecell><paragraph role="tablehead" id="par_id801687561518810">Operator(s)</paragraph> + </tablecell> + <tablecell><paragraph role="tablehead" id="par_id521687561523649">Comments</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell><paragraph role="tablecontent" id="par_id611687561527049">left</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" localize="false" id="par_id561687561531281">:</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" id="par_id651687561534345">Range.</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell><paragraph role="tablecontent" id="par_id961687561539434">left</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" localize="false" id="par_id301687561544010">!</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" id="par_id721687561546778">Reference intersection (A1:C4!B1:B5 is B1:B4).</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell><paragraph role="tablecontent" id="par_id741687561555251">left</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" localize="false" id="par_id901687561558641">~</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" id="par_id121687561561898">Reference union.</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell><paragraph role="tablecontent" id="par_id731687561708790">right</paragraph></tablecell> + <tablecell><paragraph role="tablecontent" localize="false" id="par_id61687561711845">+,-</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" id="par_id721687561715845">Prefix unary operators. For example, -5 or -A1. Note that these have a different precedence than add and subtract.</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell><paragraph role="tablecontent" id="par_id171687561719559">left</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" localize="false" id="par_id561687561722949">%</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" id="par_id791687561727359">Postfix unary operator % (divide by 100). Note that this is legal with expressions, for example, B1%.</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell><paragraph role="tablecontent" id="par_id681687561735190">left</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" localize="false" id="par_id781687561738654">^</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" id="par_id321687561741773">Power (2^3 is 8).</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell><paragraph role="tablecontent" id="par_id321687561745015">left</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" localize="false" id="par_id121687561747982">*,/</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" id="par_id431687561758704">Multiply, divide.</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell><paragraph role="tablecontent" id="par_id931687561762278">left</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" localize="false" id="par_id241687561766047">+,-</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" id="par_id731687561770325">Binary operations add, subtract. Note that unary (prefix) + and - have a different precedence.</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell><paragraph role="tablecontent" id="par_id541687561818607">left</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" localize="false" id="par_id421687561821896">&</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" id="par_id391687561825288">Binary operation string concatenation. Note that "&" shall be escaped when included in an XML document.</paragraph> + </tablecell> + </tablerow> + <tablerow> + <tablecell><paragraph role="tablecontent" id="par_id921687561831376">left</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" localize="false" id="par_id41687561835121">=, <>, <, <=,<br/>>, >=</paragraph> + </tablecell> + <tablecell><paragraph role="tablecontent" id="par_id631687561838545">Comparison operators equal to, not equal to, less than, less than or equal to, greater than, greater than or equal to.</paragraph> + </tablecell> + </tablerow> +</table> +<note id="par_id241687561247336">Prefix "-" has a higher precedence than "^", "^" is left-associative, and reference intersection has a higher precedence than reference union.</note> +<note id="par_id941687561277896">Prefix "+" and "-" are defined to be right-associative. However, note that typical applications which implement at most the operators defined in this specification (as specified) may implement them as left-associative, because the calculated results will be identical.</note> +<note id="par_id411687561295059">Precedence can be overridden by using parentheses, so "=2+3*4" computes to 14 but "=(2+3)*4" computes 20.</note> +<section id="relatedtopics"> + <paragraph role="paragraph" id="par_id661687565493405"><link href="https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part4-formula/OpenDocument-v1.3-os-part4-formula.html#Operators">OpenDocument v1.3 part 4, Formula Operators</link></paragraph> +</section> +</body> +</helpdocument> |