1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <helpdocument version=
"1.0">
5 ***********************************************************************
7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9 * Copyright 2008 by Sun Microsystems, Inc.
11 * OpenOffice.org - a multi-platform office productivity suite
13 * $RCSfile: soffice2xmlhelp.xsl,v $
16 * This file is part of OpenOffice.org.
18 * OpenOffice.org is free software: you can redistribute it and/or modify
19 * it under the terms of the GNU Lesser General Public License version 3
20 * only, as published by the Free Software Foundation.
22 * OpenOffice.org is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU Lesser General Public License version 3 for more details
26 * (a copy is included in the LICENSE file that accompanied this code).
28 * You should have received a copy of the GNU Lesser General Public License
29 * version 3 along with OpenOffice.org. If not, see
30 * <http://www.openoffice.org/license.html>
31 * for a copy of the LGPLv3 License.
33 ************************************************************************
38 <topic id=
"textscalc0104060105xml" indexer=
"include">
39 <title xml-lang=
"en-US" id=
"tit">Logical Functions
</title>
40 <filename>/text/scalc/
01/
04060105.xhp
</filename>
44 <bookmark xml-lang=
"en-US" branch=
"index" id=
"bm_id3153484"><bookmark_value>logical functions
</bookmark_value>
45 <bookmark_value>Function Wizard; logical
</bookmark_value>
46 <bookmark_value>functions; logical functions
</bookmark_value>
48 <paragraph xml-lang=
"en-US" id=
"hd_id3153484" role=
"heading" level=
"1" l10n=
"U" oldref=
"1">Logical Functions
</paragraph>
49 <paragraph xml-lang=
"en-US" id=
"par_id3149312" role=
"paragraph" l10n=
"U" oldref=
"2"><variable id=
"logischtext">This category contains the
<emph>Logical
</emph> functions.
50 </variable></paragraph>
51 <section id=
"howtoget">
52 <embed href=
"text/scalc/00/00000404.xhp#eikalo"/>
55 <section id=
"Section6">
56 <bookmark xml-lang=
"en-US" branch=
"index" id=
"bm_id3147505"><bookmark_value>AND function
</bookmark_value>
58 <bookmark xml-lang=
"en-US" branch=
"hid/HID_FUNC_UND" id=
"bm_id3145320" localize=
"false"/>
59 <paragraph xml-lang=
"en-US" id=
"hd_id3147505" role=
"heading" level=
"2" l10n=
"U"
60 oldref=
"29">AND
</paragraph>
61 <paragraph xml-lang=
"en-US" id=
"par_id3153959" role=
"paragraph" l10n=
"U" oldref=
"65"><ahelp hid=
"HID_FUNC_UND">Returns TRUE if all arguments are TRUE.
</ahelp> If one of the elements is FALSE, this function returns the FALSE value.
</paragraph>
62 <paragraph xml-lang=
"en-US" id=
"par_id3146100" role=
"paragraph" l10n=
"U" oldref=
"66">The arguments are either logical expressions themselves (TRUE,
1<5,
2+
3=
7, B8
<10) that return logical values, or arrays (A1:C3) containing logical values.
</paragraph>
63 <paragraph xml-lang=
"en-US" id=
"par_id3150538" role=
"note" l10n=
"CHG" oldref=
"67">When a function expects a single value, but you entered a cell range, then the value from the cell range is taken that is in the same column or row as the formula.
<comment>UFI: fixed #i18547#
</comment></paragraph>
64 <paragraph xml-lang=
"en-US" id=
"par_id3149128" role=
"note" l10n=
"CHG" oldref=
"68">If the entered range is outside of the current column or row of the formula, the function returns the error value #VALUE!
</paragraph>
65 <paragraph xml-lang=
"en-US" id=
"hd_id3150374" role=
"heading" level=
"3" l10n=
"U"
66 oldref=
"31">Syntax
</paragraph>
67 <paragraph xml-lang=
"en-US" id=
"par_id3159123" role=
"code" l10n=
"U" oldref=
"32">AND(LogicalValue1; LogicalValue2 ...LogicalValue30)
</paragraph>
68 <paragraph xml-lang=
"en-US" id=
"par_id3150038" role=
"paragraph" l10n=
"CHG" oldref=
"33">
69 <emph>LogicalValue1; LogicalValue2 ...LogicalValue30
</emph> are conditions to be checked. All conditions can be either TRUE or FALSE. If a range is entered as a parameter, the function uses the value from the range that is in the current column or row. The result is TRUE if the logical value in all cells within the cell range is TRUE.
</paragraph>
70 <paragraph xml-lang=
"en-US" id=
"hd_id3149143" role=
"heading" level=
"3" l10n=
"U"
71 oldref=
"34">Example
</paragraph>
72 <paragraph xml-lang=
"en-US" id=
"par_id3153123" role=
"paragraph" l10n=
"U" oldref=
"35">The logical values of entries
12<13;
14>12, and
7<6 are to be checked:
</paragraph>
73 <paragraph xml-lang=
"en-US" id=
"par_id3145632" role=
"paragraph" l10n=
"U" oldref=
"36">
74 <item type=
"input">=AND(
12<13;
14>12;
7<6)
</item> returns FALSE.
</paragraph>
75 <paragraph xml-lang=
"en-US" id=
"par_id3149946" role=
"paragraph" l10n=
"U" oldref=
"60">
76 <item type=
"input">=AND (FALSE;TRUE)
</item> returns FALSE.
</paragraph>
78 <section id=
"Section5">
79 <bookmark xml-lang=
"en-US" branch=
"index" id=
"bm_id3149015"><bookmark_value>FALSE function
</bookmark_value>
81 <bookmark xml-lang=
"en-US" branch=
"hid/HID_FUNC_FALSCH" id=
"bm_id3154678" localize=
"false"/>
82 <paragraph xml-lang=
"en-US" id=
"hd_id3149015" role=
"heading" level=
"2" l10n=
"U" oldref=
"3">FALSE
</paragraph>
83 <paragraph xml-lang=
"en-US" id=
"par_id3149890" role=
"paragraph" l10n=
"U" oldref=
"4"><ahelp hid=
"HID_FUNC_FALSCH">Returns the logical value FALSE.
</ahelp> The FALSE() function does not require any arguments, and always returns the logical value FALSE.
</paragraph>
84 <paragraph xml-lang=
"en-US" id=
"hd_id3146939" role=
"heading" level=
"3" l10n=
"U" oldref=
"5">Syntax
</paragraph>
85 <paragraph xml-lang=
"en-US" id=
"par_id3150030" role=
"code" l10n=
"U" oldref=
"6">FALSE()
</paragraph>
86 <paragraph xml-lang=
"en-US" id=
"hd_id3150697" role=
"heading" level=
"3" l10n=
"U" oldref=
"7">Example
</paragraph>
87 <paragraph xml-lang=
"en-US" id=
"par_id3154842" role=
"paragraph" l10n=
"CHG" oldref=
"8">
88 <item type=
"input">=FALSE()
</item> returns FALSE
</paragraph>
89 <paragraph xml-lang=
"en-US" id=
"par_id3147468" role=
"paragraph" l10n=
"CHG" oldref=
"9">
90 <item type=
"input">=NOT(FALSE())
</item> returns TRUE
</paragraph>
92 <section id=
"Section4">
93 <bookmark xml-lang=
"en-US" branch=
"index" id=
"bm_id3150141"><bookmark_value>IF function
</bookmark_value>
95 <bookmark xml-lang=
"en-US" branch=
"hid/HID_FUNC_WENN" id=
"bm_id3152789" localize=
"false"/>
96 <paragraph xml-lang=
"en-US" id=
"hd_id3150141" role=
"heading" level=
"2" l10n=
"U"
97 oldref=
"48">IF
</paragraph>
98 <paragraph xml-lang=
"en-US" id=
"par_id3148740" role=
"paragraph" l10n=
"U" oldref=
"49"><ahelp hid=
"HID_FUNC_WENN">Specifies a logical test to be performed.
</ahelp></paragraph>
99 <paragraph xml-lang=
"en-US" id=
"hd_id3153325" role=
"heading" level=
"3" l10n=
"U"
100 oldref=
"50">Syntax
</paragraph>
101 <paragraph xml-lang=
"en-US" id=
"par_id3154558" role=
"code" l10n=
"CHG" oldref=
"51">IF(Test; ThenValue; OtherwiseValue)
</paragraph>
102 <paragraph xml-lang=
"en-US" id=
"par_id3149727" role=
"paragraph" l10n=
"U" oldref=
"52">
103 <emph>Test
</emph> is any value or expression that can be TRUE or FALSE.
</paragraph>
104 <paragraph xml-lang=
"en-US" id=
"par_id3155828" role=
"paragraph" l10n=
"U" oldref=
"53">
105 <emph>ThenValue
</emph> (optional) is the value that is returned if the logical test is TRUE.
</paragraph>
106 <paragraph xml-lang=
"en-US" id=
"par_id3154811" role=
"paragraph" l10n=
"U" oldref=
"54">
107 <emph>OtherwiseValue
</emph> (optional) is the value that is returned if the logical test is FALSE.
</paragraph>
108 <paragraph xml-lang=
"en-US" id=
"par_idN107FA" role=
"paragraph" l10n=
"NEW">
109 <embedvar href=
"text/scalc/00/00000004.xhp#optional"/>
111 <paragraph xml-lang=
"en-US" id=
"hd_id3149507" role=
"heading" level=
"3" l10n=
"U"
112 oldref=
"55">Examples
</paragraph>
113 <paragraph xml-lang=
"en-US" id=
"par_id3150867" role=
"paragraph" l10n=
"U" oldref=
"57">
114 <item type=
"input">=IF(A1
>5;
100;
"too small")
</item> If the value in A1 is higher than
5, the value
100 is entered in the current cell; otherwise, the text “too small” (without quotes) is entered.
</paragraph>
116 <section id=
"Section3">
117 <bookmark xml-lang=
"en-US" branch=
"index" id=
"bm_id3155954"><bookmark_value>NOT function
</bookmark_value>
119 <bookmark xml-lang=
"en-US" branch=
"hid/HID_FUNC_NICHT" id=
"bm_id3145168" localize=
"false"/>
120 <paragraph xml-lang=
"en-US" id=
"hd_id3155954" role=
"heading" level=
"2" l10n=
"U"
121 oldref=
"12">NOT
</paragraph>
122 <paragraph xml-lang=
"en-US" id=
"par_id3153570" role=
"paragraph" l10n=
"CHG" oldref=
"13"><ahelp hid=
"HID_FUNC_NICHT">Complements (inverts) a logical value.
</ahelp></paragraph>
123 <paragraph xml-lang=
"en-US" id=
"hd_id3147372" role=
"heading" level=
"3" l10n=
"U"
124 oldref=
"14">Syntax
</paragraph>
125 <paragraph xml-lang=
"en-US" id=
"par_id3157996" role=
"code" l10n=
"U" oldref=
"15">NOT(LogicalValue)
</paragraph>
126 <paragraph xml-lang=
"en-US" id=
"par_id3148766" role=
"paragraph" l10n=
"CHG" oldref=
"16">
127 <emph>LogicalValue
</emph> is any value to be complemented.
</paragraph>
128 <paragraph xml-lang=
"en-US" id=
"hd_id3149884" role=
"heading" level=
"3" l10n=
"U"
129 oldref=
"17">Example
</paragraph>
130 <paragraph xml-lang=
"en-US" id=
"par_id3150132" role=
"paragraph" l10n=
"CHG" oldref=
"18">
131 <item type=
"input">=NOT(A)
</item>. If A=TRUE then NOT(A) will evaluate FALSE.
</paragraph>
133 <section id=
"Section2">
134 <bookmark xml-lang=
"en-US" branch=
"index" id=
"bm_id3148394"><bookmark_value>OR function
</bookmark_value>
136 <bookmark xml-lang=
"en-US" branch=
"hid/HID_FUNC_ODER" id=
"bm_id3155620" localize=
"false"/>
137 <paragraph xml-lang=
"en-US" id=
"hd_id3148394" role=
"heading" level=
"2" l10n=
"U"
138 oldref=
"20">OR
</paragraph>
139 <paragraph xml-lang=
"en-US" id=
"par_id3156060" role=
"paragraph" l10n=
"U" oldref=
"61"><ahelp hid=
"HID_FUNC_ODER">Returns TRUE if at least one argument is TRUE.
</ahelp> This function returns the value FALSE, if all the arguments have the logical value FALSE.
</paragraph>
140 <paragraph xml-lang=
"en-US" id=
"par_id3148771" role=
"paragraph" l10n=
"U" oldref=
"62">The arguments are either logical expressions themselves (TRUE,
1<5,
2+
3=
7, B8
<10) that return logical values, or arrays (A1:C3) containing logical values.
</paragraph>
141 <paragraph xml-lang=
"en-US" id=
"par_id3153546" role=
"note" l10n=
"CHG" oldref=
"63">When a function expects a single value, but you entered a cell range, then the value from the cell range is taken that is in the same column or row as the formula.
</paragraph>
142 <paragraph xml-lang=
"en-US" id=
"par_id3149027" role=
"note" l10n=
"CHG" oldref=
"64">If the entered range is outside of the current column or row of the formula, the function returns the error value #VALUE!
</paragraph>
143 <paragraph xml-lang=
"en-US" id=
"hd_id3155517" role=
"heading" level=
"3" l10n=
"U"
144 oldref=
"22">Syntax
</paragraph>
145 <paragraph xml-lang=
"en-US" id=
"par_id3150468" role=
"code" l10n=
"U" oldref=
"23">OR(LogicalValue1; LogicalValue2 ...LogicalValue30)
</paragraph>
146 <paragraph xml-lang=
"en-US" id=
"par_id3155819" role=
"paragraph" l10n=
"CHG" oldref=
"24">
147 <emph>LogicalValue1; LogicalValue2 ...LogicalValue30
</emph> are conditions to be checked. All conditions can be either TRUE or FALSE. If a range is entered as a parameter, the function uses the value from the range that is in the current column or row.
<comment>UFI: first try to fix bugtraq
4905779</comment></paragraph>
148 <paragraph xml-lang=
"en-US" id=
"hd_id3153228" role=
"heading" level=
"3" l10n=
"U"
149 oldref=
"25">Example
</paragraph>
150 <paragraph xml-lang=
"en-US" id=
"par_id3154870" role=
"paragraph" l10n=
"U" oldref=
"26">The logical values of entries
12<11;
13>22, and
45=
45 are to be checked.
</paragraph>
151 <paragraph xml-lang=
"en-US" id=
"par_id3155371" role=
"paragraph" l10n=
"U" oldref=
"27">
152 <item type=
"input">=OR(
12<11;
13>22;
45=
45)
</item> returns TRUE.
</paragraph>
153 <paragraph xml-lang=
"en-US" id=
"par_id3158412" role=
"paragraph" l10n=
"U" oldref=
"59">
154 <item type=
"input">=OR(FALSE;TRUE)
</item> returns TRUE.
</paragraph>
156 <section id=
"Section1">
157 <bookmark xml-lang=
"en-US" branch=
"index" id=
"bm_id3156256"><bookmark_value>TRUE function
</bookmark_value>
159 <bookmark xml-lang=
"en-US" branch=
"hid/HID_FUNC_WAHR" id=
"bm_id3148426" localize=
"false"/>
160 <paragraph xml-lang=
"en-US" id=
"hd_id3156256" role=
"heading" level=
"2" l10n=
"U"
161 oldref=
"38">TRUE
</paragraph>
162 <paragraph xml-lang=
"en-US" id=
"par_id3155985" role=
"paragraph" l10n=
"U" oldref=
"39"><ahelp hid=
"HID_FUNC_WAHR">The logical value is set to TRUE.
</ahelp> The TRUE() function does not require any arguments, and always returns the logical value TRUE.
</paragraph>
163 <paragraph xml-lang=
"en-US" id=
"hd_id3153717" role=
"heading" level=
"3" l10n=
"U"
164 oldref=
"40">Syntax
</paragraph>
165 <paragraph xml-lang=
"en-US" id=
"par_id3152590" role=
"code" l10n=
"U" oldref=
"41">TRUE()
</paragraph>
166 <paragraph xml-lang=
"en-US" id=
"hd_id3147175" role=
"heading" level=
"3" l10n=
"U"
167 oldref=
"42">Example
</paragraph>
168 <paragraph xml-lang=
"en-US" id=
"par_id3146148" role=
"paragraph" l10n=
"U" oldref=
"43">If A=TRUE and B=FALSE the following examples appear:
</paragraph>
169 <paragraph xml-lang=
"en-US" id=
"par_id3083285" role=
"paragraph" l10n=
"U" oldref=
"44">
170 <item type=
"input">=AND(A;B)
</item> returns FALSE
</paragraph>
171 <paragraph xml-lang=
"en-US" id=
"par_id3083444" role=
"paragraph" l10n=
"U" oldref=
"45">
172 <item type=
"input">=OR(A;B)
</item> returns TRUE
</paragraph>
173 <paragraph xml-lang=
"en-US" id=
"par_id3154314" role=
"paragraph" l10n=
"U" oldref=
"46">
174 <item type=
"input">=NOT(AND(A;B))
</item> returns TRUE
</paragraph>
177 <section id=
"relatedtopics">
178 <embed href=
"text/scalc/01/04060100.xhp#drking"/>