1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
***********************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: 04060105.xhp,v $fileonly,v $
*
* $Revision: 1.7 $
*
* last change: $Author: rt $ $Date: 2008-02-19 22:11:50 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
************************************************************************
-->
<helpdocument version="1.0">
<meta>
<topic id="textscalc0104060105xml" indexer="include" status="PUBLISH">
<title id="tit" xml-lang="en-US">Logical Functions</title>
<filename>/text/scalc/01/04060105.xhp</filename>
</topic>
</meta>
<body>
<bookmark xml-lang="en-US" branch="index" id="bm_id3153484"><bookmark_value>logical functions</bookmark_value>
<bookmark_value>Function Wizard; logical</bookmark_value>
<bookmark_value>functions; logical functions</bookmark_value>
</bookmark>
<paragraph role="heading" id="hd_id3153484" xml-lang="en-US" level="1" l10n="U" oldref="1">Logical Functions</paragraph>
<paragraph role="paragraph" id="par_id3149312" xml-lang="en-US" l10n="U" oldref="2"><variable id="logischtext">This category contains the <emph>Logical</emph> functions.
</variable></paragraph>
<section id="howtoget">
<embed href="text/scalc/00/00000404.xhp#eikalo"/>
</section>
<sort order="asc"><section id="Section6">
<bookmark xml-lang="en-US" branch="index" id="bm_id3147505"><bookmark_value>AND function</bookmark_value>
</bookmark>
<bookmark xml-lang="en-US" branch="hid/HID_FUNC_UND" id="bm_id3145320" localize="false"/><paragraph role="heading" id="hd_id3147505" xml-lang="en-US" level="2" l10n="U" oldref="29">AND</paragraph>
<paragraph role="paragraph" id="par_id3153959" xml-lang="en-US" 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>
<paragraph role="paragraph" id="par_id3146100" xml-lang="en-US" 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>
<paragraph role="note" id="par_id3150538" xml-lang="en-US" 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>
<paragraph role="note" id="par_id3149128" xml-lang="en-US" 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>
<paragraph role="heading" id="hd_id3150374" xml-lang="en-US" level="3" l10n="U" oldref="31">Syntax</paragraph>
<paragraph role="code" id="par_id3159123" xml-lang="en-US" l10n="U" oldref="32">AND(LogicalValue1; LogicalValue2 ...LogicalValue30)</paragraph>
<paragraph role="paragraph" id="par_id3150038" xml-lang="en-US" l10n="CHG" oldref="33">
<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>
<paragraph role="heading" id="hd_id3149143" xml-lang="en-US" level="3" l10n="U" oldref="34">Example</paragraph>
<paragraph role="paragraph" id="par_id3153123" xml-lang="en-US" l10n="U" oldref="35">The logical values of entries 12<13; 14>12, and 7<6 are to be checked:</paragraph>
<paragraph role="paragraph" id="par_id3145632" xml-lang="en-US" l10n="U" oldref="36">
<item type="input">=AND(12<13;14>12;7<6)</item> returns FALSE.</paragraph>
<paragraph role="paragraph" id="par_id3149946" xml-lang="en-US" l10n="U" oldref="60">
<item type="input">=AND (FALSE;TRUE)</item> returns FALSE.</paragraph>
</section>
<section id="Section5">
<bookmark xml-lang="en-US" branch="index" id="bm_id3149015"><bookmark_value>FALSE function</bookmark_value>
</bookmark>
<bookmark xml-lang="en-US" branch="hid/HID_FUNC_FALSCH" id="bm_id3154678" localize="false"/><paragraph role="heading" id="hd_id3149015" xml-lang="en-US" level="2" l10n="U" oldref="3">FALSE</paragraph>
<paragraph role="paragraph" id="par_id3149890" xml-lang="en-US" 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>
<paragraph role="heading" id="hd_id3146939" xml-lang="en-US" level="3" l10n="U" oldref="5">Syntax</paragraph>
<paragraph role="code" id="par_id3150030" xml-lang="en-US" l10n="U" oldref="6">FALSE()</paragraph>
<paragraph role="heading" id="hd_id3150697" xml-lang="en-US" level="3" l10n="U" oldref="7">Example</paragraph>
<paragraph role="paragraph" id="par_id3154842" xml-lang="en-US" l10n="CHG" oldref="8">
<item type="input">=FALSE()</item> returns FALSE</paragraph>
<paragraph role="paragraph" id="par_id3147468" xml-lang="en-US" l10n="CHG" oldref="9">
<item type="input">=NOT(FALSE())</item> returns TRUE</paragraph>
</section>
<section id="Section4">
<bookmark xml-lang="en-US" branch="index" id="bm_id3150141"><bookmark_value>IF function</bookmark_value>
</bookmark>
<bookmark xml-lang="en-US" branch="hid/HID_FUNC_WENN" id="bm_id3152789" localize="false"/><paragraph role="heading" id="hd_id3150141" xml-lang="en-US" level="2" l10n="U" oldref="48">IF</paragraph>
<paragraph role="paragraph" id="par_id3148740" xml-lang="en-US" l10n="U" oldref="49"><ahelp hid="HID_FUNC_WENN">Specifies a logical test to be performed.</ahelp></paragraph>
<paragraph role="heading" id="hd_id3153325" xml-lang="en-US" level="3" l10n="U" oldref="50">Syntax</paragraph>
<paragraph role="code" id="par_id3154558" xml-lang="en-US" l10n="U" oldref="51">IF(Test; ThenValue; "OtherwiseValue")</paragraph>
<paragraph role="paragraph" id="par_id3149727" xml-lang="en-US" l10n="U" oldref="52">
<emph>Test</emph> is any value or expression that can be TRUE or FALSE.</paragraph>
<paragraph role="paragraph" id="par_id3155828" xml-lang="en-US" l10n="U" oldref="53">
<emph>ThenValue</emph> (optional) is the value that is returned if the logical test is TRUE.</paragraph>
<paragraph role="paragraph" id="par_id3154811" xml-lang="en-US" l10n="U" oldref="54">
<emph>OtherwiseValue</emph> (optional) is the value that is returned if the logical test is FALSE.</paragraph>
<paragraph role="paragraph" id="par_idN107FA" xml-lang="en-US" l10n="NEW">
<embedvar href="text/scalc/00/00000004.xhp#optional"/>
</paragraph>
<paragraph role="heading" id="hd_id3149507" xml-lang="en-US" level="3" l10n="U" oldref="55">Examples</paragraph>
<paragraph role="paragraph" id="par_id3150867" xml-lang="en-US" l10n="U" oldref="57">
<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>
</section>
<section id="Section3">
<bookmark xml-lang="en-US" branch="index" id="bm_id3155954"><bookmark_value>NOT function</bookmark_value>
</bookmark>
<bookmark xml-lang="en-US" branch="hid/HID_FUNC_NICHT" id="bm_id3145168" localize="false"/><paragraph role="heading" id="hd_id3155954" xml-lang="en-US" level="2" l10n="U" oldref="12">NOT</paragraph>
<paragraph role="paragraph" id="par_id3153570" xml-lang="en-US" l10n="U" oldref="13"><ahelp hid="HID_FUNC_NICHT">Reverses the logical value.</ahelp></paragraph>
<paragraph role="heading" id="hd_id3147372" xml-lang="en-US" level="3" l10n="U" oldref="14">Syntax</paragraph>
<paragraph role="code" id="par_id3157996" xml-lang="en-US" l10n="U" oldref="15">NOT(LogicalValue)</paragraph>
<paragraph role="paragraph" id="par_id3148766" xml-lang="en-US" l10n="U" oldref="16">
<emph>LogicalValue</emph> is any value to be reversed.</paragraph>
<paragraph role="heading" id="hd_id3149884" xml-lang="en-US" level="3" l10n="U" oldref="17">Example</paragraph>
<paragraph role="paragraph" id="par_id3150132" xml-lang="en-US" l10n="U" oldref="18">
<item type="input">=NOT(A)</item>. A=TRUE reverses to A=FALSE.</paragraph>
</section>
<section id="Section2">
<bookmark xml-lang="en-US" branch="index" id="bm_id3148394"><bookmark_value>OR function</bookmark_value>
</bookmark>
<bookmark xml-lang="en-US" branch="hid/HID_FUNC_ODER" id="bm_id3155620" localize="false"/><paragraph role="heading" id="hd_id3148394" xml-lang="en-US" level="2" l10n="U" oldref="20">OR</paragraph>
<paragraph role="paragraph" id="par_id3156060" xml-lang="en-US" 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>
<paragraph role="paragraph" id="par_id3148771" xml-lang="en-US" 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>
<paragraph role="note" id="par_id3153546" xml-lang="en-US" 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>
<paragraph role="note" id="par_id3149027" xml-lang="en-US" 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>
<paragraph role="heading" id="hd_id3155517" xml-lang="en-US" level="3" l10n="U" oldref="22">Syntax</paragraph>
<paragraph role="code" id="par_id3150468" xml-lang="en-US" l10n="U" oldref="23">OR(LogicalValue1; LogicalValue2 ...LogicalValue30)</paragraph>
<paragraph role="paragraph" id="par_id3155819" xml-lang="en-US" l10n="CHG" oldref="24">
<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>
<paragraph role="heading" id="hd_id3153228" xml-lang="en-US" level="3" l10n="U" oldref="25">Example</paragraph>
<paragraph role="paragraph" id="par_id3154870" xml-lang="en-US" l10n="U" oldref="26">The logical values of entries 12<11; 13>22, and 45=45 are to be checked.</paragraph>
<paragraph role="paragraph" id="par_id3155371" xml-lang="en-US" l10n="U" oldref="27">
<item type="input">=OR(12<11;13>22;45=45)</item> returns TRUE.</paragraph>
<paragraph role="paragraph" id="par_id3158412" xml-lang="en-US" l10n="U" oldref="59">
<item type="input">=OR(FALSE;TRUE)</item> returns TRUE.</paragraph>
</section>
<section id="Section1">
<bookmark xml-lang="en-US" branch="index" id="bm_id3156256"><bookmark_value>TRUE function</bookmark_value>
</bookmark>
<bookmark xml-lang="en-US" branch="hid/HID_FUNC_WAHR" id="bm_id3148426" localize="false"/><paragraph role="heading" id="hd_id3156256" xml-lang="en-US" level="2" l10n="U" oldref="38">TRUE</paragraph>
<paragraph role="paragraph" id="par_id3155985" xml-lang="en-US" 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>
<paragraph role="heading" id="hd_id3153717" xml-lang="en-US" level="3" l10n="U" oldref="40">Syntax</paragraph>
<paragraph role="code" id="par_id3152590" xml-lang="en-US" l10n="U" oldref="41">TRUE()</paragraph>
<paragraph role="heading" id="hd_id3147175" xml-lang="en-US" level="3" l10n="U" oldref="42">Example</paragraph>
<paragraph role="paragraph" id="par_id3146148" xml-lang="en-US" l10n="U" oldref="43">If A=TRUE and B=FALSE the following examples appear:</paragraph>
<paragraph role="paragraph" id="par_id3083285" xml-lang="en-US" l10n="U" oldref="44">
<item type="input">=AND(A;B)</item> returns FALSE</paragraph>
<paragraph role="paragraph" id="par_id3083444" xml-lang="en-US" l10n="U" oldref="45">
<item type="input">=OR(A;B)</item> returns TRUE</paragraph>
<paragraph role="paragraph" id="par_id3154314" xml-lang="en-US" l10n="U" oldref="46">
<item type="input">=NOT(AND(A;B))</item> returns TRUE</paragraph>
</section>
</sort></body>
</helpdocument>
|