RFNXVfwQQPS4J

Creating formulas using testing for conditions

Source: licencja: CC 0.

Projektowanie formuł wykorzystujących sprawdzanie warunków

You will learn
  • what conditional functions in a spreadsheet are,

  • how to specify conditions (criteria) in conditional functions,

  • how to use them.

R1cvTws31X5Pd1
nagranie abstraktu

The IF functionfunctionfunction allows you to make logical comparisons between the value of a cell and the expected value. When you use the IF function, you must specify three argumentsargumentsarguments:

RoEhVJ8OCLjIZ
Ilustracja interaktywna przedstawia zapisaną funkcję logiczną =IF(logical_test, value_if_true, value_if_false). Elementy funkcji IF zostały oznaczone numerami od 1 do 3. 1 - logical_test. 2 - value_if_true. 3 - value_if_false. Na ilustracji widoczne są numery, a na nich podpisy. 1. A logical test, i.e. testing if the specified condition is met. {audio}, 2. The value of a cell when the condition is met. {audio}, 3. The value of a cell when the condition is not met. {audio}
The IF function
Source: GroMar, licencja: CC BY 3.0.
R7vwN0f33Da5I1
nagranie abstraktu

Colloquially, the operation of the IF function could be described as follows: IF (the expression is true, then perform the specified operation, otherwise perform another operation). The IF function is also called a conditional functionconditional functionconditional function. It can be inserted with the function wizard or by using the keyboard. Conditional functions can be nested, which will be explained later.

R1S72X0s13JQe
The IF function wizard box
Source: GroMar, licencja: CC BY 3.0.
RMxV7COGhRbLS
The logical formula containing the IF function.
Source: GroMar, licencja: CC BY 3.0.
Task 1
R1KXvPUtaLG4p1
nagranie abstraktu

Download the file fruits.xls. By using the IF functionfunctionfunction, create a conditional statement which will return one of the two valuesvaluesvalues in the column State: “realized” (when a given person has exceeded the limit) or “unrealized” (when a person has not exceeded the limit). In the column Surplus, insert the value of the surplus for people who have exceeded the limit. For people who have not reached the limit, insert 0 (zero) in the column Surplus.

R1WBJmkUPisGj1
Plik z danymi do zadnia
Source: GroMar Sp. z o.o., licencja: CC BY 3.0.
R16ChtVQyMhrY1
nagranie abstraktu

The If function can return the value of mathematical calculations. In the boxes Value_if_true and Value_if_false, you can enter mathematical expressionsmathematical expressionsmathematical expressions calculating valuesvaluesvalues.

Task 2
R1GiZA1mUeZvS1
nagranie abstraktu

Calculate a bonus for the employees by awarding the bonus of 10% of the income for persons whose income is less than 5000 and of 5% of the income for persons whose income is more than 5000.

R1HN0rml453O8
Task data
Source: GroMar, licencja: CC BY 3.0.
R1EiGkuvUxdFp1
nagranie abstraktu

The COUNTIF functionfunctionfunction enables to count the number of cells that meet a specified criterioncriterioncriterion. Practically, the syntax of this instructioninstructioninstruction can be translated as follows:

RTGJDumNRQwKK
Ilustracja interaktywna przedstawia zapisaną funkcję logiczną =COUNTIF(range, criteria). Elementy funkcji IF zostały oznaczone numerami od 1 do 2. 1 - range. 2 - criteria. Na ilustracji widoczne są numery, a na nich podpisy. 1. Where do you want to look? {audio}, 2. What do you want to look for? {audio}
The COUNTIF function
Source: GroMar, licencja: CC BY 3.0.
RZyRvAUc9zeFW1
nagranie abstraktu

The text‑based criteria of searching for valuesvaluesvalues counted by the function are not case sensitive. Wildcard characters – the question mark (?) and asterisk (*) – which match any single character or any sequence of characters, respectively – can be used in criteria.

RM8EdN1rSWcR2
The arguments of the COUNTIF function
Source: GroMar, licencja: CC BY 3.0.
Task 3
R1XPOkbo9SVyg1
nagranie abstraktu

In the fruits.xls spreadsheet, count how many persons were picking the particular fruits and how many of them have reached their limits.

Re1q3XMj368Ef1
nagranie abstraktu

The SUMIF functionfunctionfunction is used to sum the valuesvaluesvalues in a range that meet criteria specified by the user. The criteria argument may contain numbers, text, expressions and cell references.

R1NgEGGTna14h
Ilustracja interaktywna przedstawia zapisaną funkcję logiczną =SUMIF(range, criteria, sum_range). Elementy funkcji IF zostały oznaczone numerami od 1 do 3. 1 - range. 2 - criteria. 3 - sum_range. Na ilustracji widoczne są numery, a na nich podpisy. 1. The range of cells that you want to evaluate by criteria. {audio}, 2. The criteria, i.e. a condition to be met. They can be expressed as: 13, "<48", A5, "77", "John", or TODAY (). {audio}, 3. Optional. The actual cells to add, if you want to add cells other than those specified in the range argument (1). If the sum_range argument is omitted, the function adds the cells specified in the range argument. {audio}
The SUMIF function
Source: GroMar, licencja: CC BY 3.0.
R1dVVy0B48WH1
The arguments of the SUMIF function
Source: GroMar, licencja: CC BY 3.0.
Task 4
R1R5nTJDe3Hot1
nagranie abstraktu

In the fruits.xls spreadsheet, count how many kilograms of fruits have been picked in total by all persons.

R1E6aVCvuwTHd1
nagranie abstraktu

The IF functionfunctionfunction is one of the most popular functions in Excel. The logical functions in Excel enable browsing and analysing data. Every expanded formulaformulaformula searching for data in a spreadsheet performs various tests for assumptions or comparisons with required criteria. Therefore you can say that “the spreadsheet is intelligent”.

Exercises

Exercise 1
RgKgjr0wfyNyU
Wersja alternatywna ćwiczenia: Determine which sentences are true. Możliwe odpowiedzi: 1. The IF function can be inserted with the function wizard or by using the keyboard. , 2. The IF function cannot return the value of mathematical calculations., 3. The SUMIF function is used to sum the values in a range that meet criteria specified by the user. , 4. The COUNTIF function enables to count the number of cells that meet a specified criterion.
zadanie
Source: GroMar, licencja: CC BY 3.0.
Exercise 2

Analyse the syntax of the IF function inserted in cell B3. What will be the value returned by the function in both cases if cell A3 contains the number 1000? Why?

Równa się IF otwarcie nawiasy okrągłego, A3 jest większe od 100 średnik 1 średnik -1,  zamknięcie nawiasy okrągłego.
Równa się IF otwarcie nawiasy okrągłego, A3 jest większe od 100 średnik 1 średnik -1,  zamknięcie nawiasy okrągłego.
Równa się IF  otwarcie nawiasy okrągłego, A3 jest mniejsze od 100 średnik -1 średnik 1, zamknięcie nawiasy okrągłego.
Równa się IF  otwarcie nawiasy okrągłego, A3 jest mniejsze od 100 średnik -1 średnik 1, zamknięcie nawiasy okrągłego.
Exercise 3

Describe in English the differences between the SUMIF and COUNTIF functions.

Exercise 4
R1Rps8UkHmE5t
Wersja alternatywna ćwiczenia: Indicate which pairs of expressions or words are translated correctly. Możliwe odpowiedzi: 1. funkcja - function, 2. argumenty - arguments, 3. wartości - values, 4. kryterium - criterion, 5. formuła - instruction, 6. funkcja warunkowa - mathematical expressions
zadanie
Source: GroMar, licencja: CC BY 3.0.
RhDoDHx2xuqhR1
Interaktywna gra, polegająca na łączeniu wyrazów w pary w ciągu jednej minuty. Czas zaczyna upływać wraz z rozpoczęciem gry. Jeden ruch to odkrywanie najpierw jednej potem drugiej karty z wyrazem. Każdy wyraz jest odczytywany. Kolejny ruch to odkrywanie trzeciej i czwartej karty. W ten sposób odsłuchasz wszystkie wyrazy. Nawigacja z poziomu klawiatury za pomocą strzałek, odsłuchiwanie wyrazów enterem lub spacją. Znajdź wszystkie pary wyrazów.
Source: Zespół autorski Politechniki Łódzkiej, licencja: CC BY 3.0.

Glossary

arguments
arguments

argumenty

Rklqj38P93MEH1
wymowa w języku angielskim: arguments
conditional function
conditional function

funkcja warunkowa

R78mU9LewR7i01
wymowa w języku angielskim: conditional function
criterion
criterion

kryterium

R1PFaC9WYrmvu1
wymowa w języku angielskim: criterion
formula
formula

formuła

R1LumIds6yQmN1
wymowa w języku angielskim: formula
function
function

funkcja

RVbnhRdATs5AP1
wymowa w języku angielskim: function
instruction
instruction

instrukcja

RyCCuvEkuAYh81
wymowa w języku angielskim: instruction
mathematical expressions
mathematical expressions

wyrażenia matematyczne

RFMqbipasyed01
wymowa w języku angielskim: mathematical expressions
values
values

wartości

R15bPJR35wFwQ1
wymowa w języku angielskim: values

Keywords

argumentsargumentsarguments

criterioncriterioncriterion

functionfunctionfunction

valuesvaluesvalues