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.
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(Logická Hodnota 1; Logická Hodnota 2 ...Logická Hodnota 30)
LogicalValue1; LogicalValue2 ...LogicalValue30 are conditions to be checked. All conditions can be either TRUE or FALSE. If a range is entered as a parameter, the function uses all values of the range. The result is TRUE if the logical value in all cells within the cell range is TRUE.
Príklad
Logické hodnoty položiek 12<13; 14>12, a 7<6 sa majú skontrolovať.
=ISODD(48) vráti FALSE
=N(FALSE) vráti 0
FALSE
Vráti logickú hodnotu FALSE. Funkcia FALSE() nevyžaduje žiadne argumenty a vždy vráti logickú hodnotu FALSE.
Syntax
FALSE()
Príklad
=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.
Príklady
=IF(A1>5;100;"too small") 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.
NOT
Complements (inverts) a logical value.
Syntax
NOT(Logická hodnota)
LogicalValue is any value to be complemented.
Príklad
=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(Logická Hodnota 1; Logická Hodnota 2 ...Logická Hodnota 30)
LogicalValue1; LogicalValue2 ...LogicalValue30 are conditions to be checked. All conditions can be either TRUE or FALSE. If a range is entered as a parameter, the function uses all values of the range.
Príklad
Logické hodnoty jednotlivých parametrov sú 12<11, 13>22 a 45=45.
=ISODD(48) vráti FALSE
=N(FALSE) vráti 0
TRUE
Vráti logickú hodnotu TRUE (pravda). Funkcia TRUE() nevyžaduje žiadne argumenty a vždy vráti logickú hodnotu TRUE.
Syntax
TRUE()
Príklad
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.
Syntax
OR(Logická Hodnota 1; Logická Hodnota 2 ...Logická Hodnota 30)
Príklad
=N(FALSE) vráti 0
=N(FALSE) vráti 0
=N(FALSE) vráti 0