G2A |
Tabužky |
Kontakt: palkovaj@yahoo.com |
|
12. Rozhodovanie II a náhodné hodnoty |
![]() |
Logical function OR: Another logical function that you may use in your decision making calculations is function OR. This function takes two or more conditions and if at least one of the conditions is true then the whole function is true. For example if a person is below 10 years old, OR above 18 years old, he or she is not a teenager. The syntax of this function is like: OR(condition1 ; condition2 ; ...here you may put any number of conditions...) or, in Slovak MS Excel use "ALEBO" and in Czech use "NEBO" instead of "OR" To use this function inside an IF statement, write it in place of condition: IF(OR(A1<10;A1>18);"not a teenager";"teenager") COUNTIF: calculates the number of cells that meet your condition. The syntax is: COUNTIF(range of cells;condition) for example: COUNTIF(A1:A10;0) - this will count how many appearances of number 0 are in cells from A1 to A10. Generating RANDOM numbers: use function RANDOM() or, in Czech MS Excell function NÁHCÍSLO(). This will generate a random number between 0 and 1. If you want to generate whole numbers, you will need to do some calculations:
1. Use the data from exercise from previous lesson to complete the table using OR function and these conditions:
"Teenager" (between 10 and 18) or "Not a teenager" (below 10 or above 18) ![]() 2. Use function COUNTIF to calculate how many teenagers are in the group from previous table. 3. Save and open these exercises and follow the instructions in them to complete the tasks. |