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

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial content)
 
m
Line 3: Line 3:
 
== AND  ==
 
== AND  ==
 
Returns '''TRUE''' if all the arguments are considered '''TRUE''', and '''FALSE''' otherwise.
 
Returns '''TRUE''' if all the arguments are considered '''TRUE''', and '''FALSE''' otherwise.
 
  
 
=== Syntax: ===
 
=== Syntax: ===
Line 12: Line 11:
  
 
<tt>'''AND'''</tt> tests every value (as an argument, or in each referenced cell), and returns <tt>'''TRUE'''</tt> if they are all <tt>'''TRUE'''</tt>. Any value which is a '''non-zero number''' or '''text''' is considered to be <tt>'''TRUE'''</tt>.  
 
<tt>'''AND'''</tt> tests every value (as an argument, or in each referenced cell), and returns <tt>'''TRUE'''</tt> if they are all <tt>'''TRUE'''</tt>. Any value which is a '''non-zero number''' or '''text''' is considered to be <tt>'''TRUE'''</tt>.  
 
  
 
=== Example: ===
 
=== Example: ===
Line 24: Line 22:
 
<tt>'''AND(C2:C3)'''</tt>)
 
<tt>'''AND(C2:C3)'''</tt>)
 
: returns <tt>'''TRUE'''</tt>.
 
: returns <tt>'''TRUE'''</tt>.
 
  
 
=== See also: ===
 
=== See also: ===

Revision as of 17:16, 25 January 2008


AND

Returns TRUE if all the arguments are considered TRUE, and FALSE otherwise.

Syntax:

AND(argument1; argument2 ...argument30)

argument1 to argument30 are up to 30 arguments, each of which may be a logical result or value, or a reference to a cell or range.


AND tests every value (as an argument, or in each referenced cell), and returns TRUE if they are all TRUE. Any value which is a non-zero number or text is considered to be TRUE.

Example:

If cells A5:B8 all contain TRUE, cell C2 contains =TRUE() and cell C3 contains "dog":

AND(2<4;A5:B8;C2)

returns TRUE.

AND(2<4;FALSE)

returns FALSE.

AND(C2:C3))

returns TRUE.

See also:

OR function, NOT function

Logical functions

Personal tools