Contents

# Logicne funkcije

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.

To access this command...

Insert - Function - Category Logical

### ISNA

Vraća TRUE ukoliko ćelija sadrži #N/A (vrijednost nije dostupna) gresku.

Ukoliko se grečka pojavi vrati FALSE.

#### Sintaksa

ISNA(Value)

Vrijednost je vrijednost ili izraz koji se testira

#### Primjer

=ISNA(D3) returns 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.

#### Sintaksa

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.

#### Primjer

=ISERROR(C8)gdje ćelija C8 sadrži =1/0 returns TRUE, because 1/0 is an error.

=ISERROR(C8)gdje ćelija C8 sadrži =1/0 returns TRUE, because 1/0 is an error.

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

## Ako

Specifira logicni test.

#### Sintaksa

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

Test je bilo koja vrijednost ili izraz koji moze biti tacan i lazan.

Then_value (optional) je vrijednost TRUE.

Otherwise_value (optional) je vrijednost 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.

#### Primjer

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

## FALSE

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

#### Sintaksa

FALSE()

#### Primjer

=FALSE() returns FALSE

=NOT(FALSE()) returns TRUE

## I

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.

#### Sintaksa

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.

#### Primjer

Logicne vrijednosti 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.

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

## NOT

Obrce logicnu vrijednost

#### Sintaksa

NOT(Logicna vrijednost)

Logical Value je bilo koja vrijednot izvrnuta

#### Primjer

=NOT(A). A=TRUE reverses to A=FALSE.

## OR

Returns TRUE ako je najmanje jedan argument TRUE. Ova funkcija vraca vrijednost FALSE ako su svi argumenti logicni 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.

#### Sintaksa

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.

#### Primjer

Unosi logicnih vrijednosti 12<11; 13>22 and 45=45 su cekirane.

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

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

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.

#### Sintaksa

TRUE()

#### Primjer

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.

This function is available since LibreOffice 4.0.

#### Sintaksa

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.

#### Primjer

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

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

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

Related Topics

Functions by Category