Logical Functions

This category contains the Logical functions.

Handling non-logical arguments in logical functions

Щоб скористатися цією командою…

Вставка - Функція - Категорія Логічні


ISNA

Returns TRUE if a cell contains the #N/A (value not available) error value.

If an error occurs, the function returns FALSE.

Синтаксис

ISNA(Value)

Value is the value or expression to be tested.

Приклад

=ISNA(D3) returns FALSE as a result.

IFERROR

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

tip

Ця фукція доступна з версії LibreOffice 4.0.


Синтаксис

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.

Приклад

=IFERROR(C8;C9), якщо комірка C8 містить =1/0, повертає значення з C9, бо 1/0 — це помилка.

=IFERROR(C8;C9), якщо комірка C8 містить 13, повертає 13 - значення C8, яке не є помилкою.

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

Returns TRUE if all arguments are TRUE. If one of the elements is FALSE, this function returns the FALSE value.

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.

Синтаксис

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.

note

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.


Приклад

The logical values of entries 12<13; 14>12, and 7<6 are to be checked:

=AND(12<13;14>12;7<6) returns FALSE.

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

note

The array formula {=AND(B1:B10;C1:C10)} yields a one-dimensional value of TRUE when all components of B1:B10 and C1:C10 are TRUE. The array expression above does not produce the logical AND per element, and thus does not produce an array of logical values. To compute a logical AND of arrays per element use the * operator in array context. In the example, enter {=B1:B10*C1:C10}.


FALSE

Returns the logical value FALSE. The FALSE() function does not require any arguments, and always returns the logical value FALSE.

Синтаксис

FALSE()

Приклад

=FALSE() returns FALSE

=NOT(FALSE()) returns TRUE

IF

Specifies a logical test to be performed.

Синтаксис

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.

У функціях LibreOffice Calc необов'язкові параметри можна залишати порожніми лише тоді, коли після них немає інших параметрів. Наприклад, якщо функція має чотири параметри і два останні параметри не є обов'язковими, то можна залишити порожніми параметри 3 і 4 або параметр 4. Залишити порожнім параметр 3 не можна.

Приклад

=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.

Синтаксис

NOT(LogicalValue)

LogicalValue is any value to be complemented.

Приклад

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

OR

Returns TRUE if at least one argument is TRUE. This function returns the value FALSE, if all the arguments have the logical value FALSE.

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.

Синтаксис

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.

note

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.


Приклад

The logical values of entries 12<11; 13>22, and 45=45 are to be checked.

=OR(12<11;13>22;45=45) returns TRUE.

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

note

The array formula {=OR(B1:B10;C1:C10)} yields a one-dimensional value of FALSE when all components of B1:B10 and C1:C10 are FALSE. The array expression above does not produce the logical OR per element, and thus does not produce an array of logical values. To compute a logical OR of arrays per element use the + operator in array context. In the example, enter {=B1:B10+C1:C10}.


TRUE

The logical value is set to TRUE. The TRUE() function does not require any arguments, and always returns the logical value TRUE.

Синтаксис

TRUE()

Приклад

If A=TRUE and B=FALSE the following examples appear:

=AND(A;B) returns FALSE

=OR(A;B) returns TRUE

=NOT(AND(A;B)) returns TRUE

XOR

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

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.

tip

Ця фукція доступна з версії LibreOffice 4.0.


Синтаксис

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.

Приклад

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

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

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

Будь ласка, підтримайте нас!