# Logické funkcie

This category contains the Logical functions.

### Handling non-logical arguments in logical functions

• Zero (0) is equivalent to FALSE and all other numbers are equivalent to TRUE.

• Empty cells and text in cells are ignored.

• A #VALUE error is raised if all arguments are ignored.

• A #VALUE error is raised if one argument is direct text (not text in a cell).

• Errors as argument lead to an error.

Pre prístup k tomuto príkazu...

Insert - Function - Category Logical

### ISNA

Vracia TRUE, pokiaľ bunka obsahuje chybovú hodnotu #N/A (hodnota nie je k dispozícii).

Pokiaľ dôjde k chybe, funkcia vracia FALSE.

#### Syntax

ISNA(Hodnota)

Hodnota je hodnota alebo výraz určený k testovaniu.

#### Example

=ISNA(D3) vracia ako výsledok FALSE.

### ISERROR

Returns the value if the cell does not contain an error value, or the alternative value if it does.

This function is available since LibreOffice 4.0.

#### Syntax

IFERROR(Value; Alternate_value)

Value is the value or expression to be returned if it is not equal or results in an error.

Alternate_value is the value or expression to be returned if the expression or value of Value is equal or results in an error.

#### Example

=ISERROR(C8) kde bunka obsahuje =1/0 a vracia TRUE, pretože 1/0 je chyba.

=ISERROR(C8) kde bunka obsahuje =1/0 a vracia TRUE, pretože 1/0 je chyba.

## IFS

IFS is a multiple IF-function.

## SWITCH

SWITCH compares expression with value1 to valuen and returns the result belonging to the first value that equals expression. If there is no match and default_result is given, that will be returned.

## AND

Vráti TRUE, ak sú všetky argumenty TRUE. Keď je jediný z argumentov FALSE, vráti táto funkcie hodnotu FALSE.

Argumenty môžu byť logickými hodnotami (TRUE, 1<5, 2+3=7, B8<10) alebo môžu označovať oblasti (A1:C3) obsahujúce logické hodnoty.

#### Syntax

AND(Logical 1 [; Logical 2 [; … [; Logical 255]]])

Logical 1, Logical 2, … , Logical 255 are boolean values, references to cells or to cell ranges of logical values.

This function ignores any text or empty cell within a data range. If you suspect wrong results from this function, look for text in the data ranges. To highlight text contents in a data range, use the value highlighting feature.

#### Example

Logické hodnoty položiek 12<13; 14>12, a 7<6 sa majú skontrolovať.

=ISODD(48) vráti FALSE

=AND(FALSE();TRUE()) returns FALSE.

## FALSE

Vráti logickú hodnotu FALSE. Funkcia FALSE() nevyžaduje žiadne argumenty a vždy vráti logickú hodnotu FALSE.

FALSE()

#### Example

=ISEVEN(33) vráti FALSE

=N(FALSE) vráti 0

## IF

Špecifikuje logický test, ktorý má byť vykonaný.

#### Syntax

IF(Test [; [ThenValue] [; [OtherwiseValue]]])

Test is any value or expression that can be TRUE or FALSE.

ThenValue (optional) is the value that is returned if the logical test is TRUE.

OtherwiseValue (optional) is the value that is returned if the logical test is FALSE.

In the LibreOffice Calc functions, parameters marked as "optional" can be left out only when no parameter follows. For example, in a function with four parameters, where the last two parameters are marked as "optional", you can leave out parameter 4 or parameters 3 and 4, but you cannot leave out parameter 3 alone.

#### Example

=IF(A1>5;100;"too small") If the value in A1 is greater than 5, the value 100 is returned; otherwise, the text too small is returned.

=IF(A1>5;;"too small") If the value in A1 is greater than 5, the value 0 is returned because empty parameters are considered to be 0; otherwise, the text too small is returned.

=IF(A1>5;100;) If the value in A1 is less than 5, the value 0 is returned because the empty OtherwiseValue is interpreted as 0; otherwise 100 is returned.

## NOT

Complements (inverts) a logical value.

#### Syntax

NOT(Logická hodnota)

LogicalValue is any value to be complemented.

#### Example

=NOT(A). If A=TRUE then NOT(A) will evaluate FALSE.

## OR

Vracia TRUE pokiaľ je aspoň jeden argument TRUE. Táto funkcia vracia FALSE, ak všetky argumenty majú logickú hodnotu FALSE.

Argumenty môžu byť logickými hodnotami (TRUE, 1<5, 2+3=7, B8<10) alebo môžu označovať oblasti (A1:C3) obsahujúce logické hodnoty.

#### Syntax

OR(Logical 1 [; Logical 2 [; … [; Logical 255]]])

Logical 1, Logical 2, … , Logical 255 are boolean values, references to cells or to cell ranges of logical values.

This function ignores any text or empty cell within a data range. If you suspect wrong results from this function, look for text in the data ranges. To highlight text contents in a data range, use the value highlighting feature.

#### Example

Logické hodnoty jednotlivých parametrov sú 12<11, 13>22 a 45=45.

=ISODD(48) vráti FALSE

=OR(FALSE();TRUE()) returns TRUE.

## TRUE

Vráti logickú hodnotu TRUE (pravda). Funkcia TRUE() nevyžaduje žiadne argumenty a vždy vráti logickú hodnotu TRUE.

TRUE()

#### Example

Pokiaľ A=TRUE a B=FALSE, budú platiť nasledujúce zápisy:

=ISODD(48) vráti FALSE

=ISODD(33) vráti TRUE

=ISEVEN(0) vráti TRUE

## XOR

Returns true if an odd number of arguments evaluates to TRUE.

Argumenty môžu byť logickými hodnotami (TRUE, 1<5, 2+3=7, B8<10) alebo môžu označovať oblasti (A1:C3) obsahujúce logické hodnoty.

This function is available since LibreOffice 4.0.

#### Syntax

XOR(Logical 1 [; Logical 2 [; … [; Logical 255]]])

Logical 1, Logical 2, … , Logical 255 are boolean values, references to cells or to cell ranges of logical values.

#### Example

=XOR(TRUE();TRUE()) returns FALSE

=XOR(TRUE();TRUE();TRUE()) returns TRUE

=XOR(FALSE();TRUE()) returns TRUE