Presentation is loading. Please wait.

Presentation is loading. Please wait.

Numeric and Functional. A cell is the intersection of a row and column Each cell in the spreadsheet has a name – The column-name followed by the row-name.

Similar presentations


Presentation on theme: "Numeric and Functional. A cell is the intersection of a row and column Each cell in the spreadsheet has a name – The column-name followed by the row-name."— Presentation transcript:

1 Numeric and Functional

2 A cell is the intersection of a row and column Each cell in the spreadsheet has a name – The column-name followed by the row-name

3 A range denotes a block of cells. A range is typed as: – upper-left-cell:bottom-right-cell For example: – A5:C7

4 A cell can contain one of three kinds of data – Value : yes, we’re talking about numbers – Formula : yes, we’re talking about math things Formula are used to derive information (values or text) from already existing information (values or text) A cell containing a formula will display the value obtained by the formula – not the formula itself! – Text : yes, we’re talking about everything else

5 A formula is a mathematical expression that combines existing data to produce a result. Formula always begin with an ‘=‘ symbol Formula may contain values, cell-references, operators, parenthesis, and function calls. =10+A5 =B1+B2+B3 =C9/B2 =Max(A1:B3)+10

6 consider the following formula =3 + A1 What does the “A1” mean? – A1 is a “cell reference” – The value contained in cell A1 is substituted in the above expression – What if cell A1 contains a 3 =a2 =3+9 =3+a2 6 6

7 All operators take data as input (operands) and produce a result. – Binary operators take two inputs and produce a result – Binary operators in Excel include Addition: (+) as in =10+A5 Subtraction: (-) as in =10-A5 Multiplication: (*) as in =10*A5 Division: (/) as in =10/A5 Exponentiation: (^) as in=10^A5 10 A5 Result +

8 Question: what does the following formula produce? – =10 + 35 * 2 ^ 2 – 1 – 10 / 5 All operators have a precedence which determines the order of evaluation within a large formula – Addition and Subtraction have lowest precedence – Multiplication and Division have identical mid-level precedence – Exponentiation has the highest precedence Rule for formula evaluation is: – Select the highest-precedence operator and evaluate – If two operators have the same highest-precedence, choose the left-most operator – Repeat until there are no more operators

9 =10 + 35 * 2 ^ 2 – 1 – 10 / 5 Rule for formula evaluation is: – Select the highest-precedence operator and evaluate – If two operators have the same highest-precedence, choose the left-most operator =10 + 35 * 4 – 1 – 10 / 5 =10 + 140 – 1 – 10 / 5 =10 + 140 – 1 – 2 =150 – 1 – 2 =149 – 2 =147

10 =(10 + 35) * 2 ^(( 4 – 1) – 10 / 5) Parenthesis can change the precedence: – Evaluate sub-expressions in parenthesis first and then proceed. =45 * 2 ^ ((4-1) – 10 / 5) =45 * 2 ^ (3 – 10 / 5) =45 * 2 ^ (3 – 2) =45 * 2 ^ 1 =45 * 2 =90

11 Formula may also contain function calls. – A function is a way of processing input to obtain output. – Excel has 100’s of built-in functions. We will discuss the most commonly used. Function syntax is: – FUNCTION_NAME ( input1, input2, … ) – Inputs are numbers, cell references, or ranges that the function needs in order to perform it’s job – The entire expression represents the function’s value (or output). 11

12 Commonly used functions include: – AVERAGE( values ) Computes the average value of the input numbers. Values is typically a range but may be a comma-separated list of items. – MAX( values ) Computes the maximum value of the input numbers. Values is typically a range but may be a comma-separated list of items. – MIN( values ) Computes the minimum value of the input numbers. Values is typically a range but may be a comma-separated list of items. – SUM( values ) Computes the sum of the input numbers. Values is typically a range but may be a comma-separated list of items. 12

13 13 What should be entered into cells – B13 to obtain classroom average for HW1? – C13 to obtain classroom average for HW2? – D13 to obtain classroom average for HW3? – E6 to obtain the total points for Britney Spears? – E13 to obtain the classroom average for all HW? =AVERAGE(B6:B10) =AVERAGE(C6:C10) =AVERAGE(D6:D10) =SUM(B6:D6) =AVERAGE(E6:E10) =(49+76+94+89+98)/5

14 Relational operators produce logical values There are exactly two logical values – True – False Comparison operators are binary operators – Each operand must be a number OperatorMeaning <Less than >Greater than =Equal to >=Greater than or equal to <=Less than or equal to <>Not equal to 14

15 15 Relational operators produce logical values =10 < 30 =30 = 30 =30 <> 30 =35 > 30 =A5 > B5

16 16 Logical functions process logical values – There are exactly two logical values True False – Logical values can be combined using Conjunction (and) Disjunction (or) Negation (not)

17 Logical functions include – AND( input1, input2) Each input value must be either true or false. The result of the function TRUE if both inputs are true and FALSE otherwise – OR( input1, input2) Each input value must be either true or false. The result of the function FALSE if both inputs are false and TRUE otherwise – NOT( input ) The input must be either true or false The result of the function is TRUE if the input is false and FALSE otherwise 17

18 In logical predicates, logical expressions used OPERATORS – The OR was used BETWEEN the operands A OR B In Excel, logical predicates are FUNCTIONS – The OR occurs BEFORE the operands =OR( A5 > 10, B5 > 10) 18

19 19 Often need to make decisions based on a criteria For example: a company contributes 4% of an employees salary to health care if they are full time and makes no contribution if they are part timers. What to enter?

20 20 The IF function is used to select exactly ONE value from exactly TWO choices IF( criteria, ifTrue, ifFalse ) – Criteria must be a logical (boolean) value – Function returns ifTrue if criteria is true and ifFalse otherwise =IF(10>5, “YES”, “NO”) YES =IF(10>=20, 30, 50) 50 =IF(A5=10, B5, C5) ??

21 21 What to enter into cell E10? =IF(B10=“PT”, 0, C10*.04)

22 22 What to enter into cell D10 to compute the scholarship award for Britney Spears? =IF(OR(B10>=MIN_GPA, C10>=MIN_SAT), award, 0) =IF(OR(B10>=B5, C10>=B6), award, 0)

23 23 When a cell reference occurs in a formula it may be a – RELATIVE Reference Default References are interpreted with respect to the containing cell When moving/copying relative cell reference, the cell reference changes by the amount moved – ABSOLUTE Reference Must be explicitly written (not the default) The cell reference is always the same, even if it is moved/copied to another cell. – MIXED Reference Either the column-part or the row-part is RELATIVE while the other part in ABSOLUTE

24 24 To specify absolute referencing for part of a reference, prefix the row and/or column part with a ‘$’ For each of the following cell references, identify it as absolute, mixed, or relative. MixedA$3 Mixed$A3 Absolute$A$3 Relative (default)A3 ModeCell Reference Example

25 25 ABCDE 10 11 12 13 = D10+D13 14 =B11+B14 Using relative addressing, the formula changes when copied For example, copy the formula from cell A14 to cell C13 The reference B11 in A14 MEANS the cell one col right and two rows up The reference B14 in A14 MEANS the cell one col right and zero rows up Since the MEANING is preserved when copying – the formula must change =??+??

26 26 ABCDE 10 11 12 13 = D$11+D$14 14 =B$11+B$14 Using relative addressing, the formula changes when copied For example, copy the formula from cell A14 to cell C13 The reference B$11 in A14 MEANS the cell one col right in row 11 The reference B$14 in A14 MEANS the cell one col right in row 14 Since the MEANING is preserved when copying – the formula must change =??+??

27 27 ABCDE 10 11 12 13 = $B10+$B13 14 =$B11+$B14 Using relative addressing, the formula changes when copied For example, copy the formula from cell A14 to cell C13 The reference $B11 in A14 MEANS the cell in col B 3 rows up The reference $B14 in A14 MEANS the cell in col B in the same row Since the MEANING is preserved when copying – the formula must change =??+??

28 28 Most times, a formula will be copied into a large number of adjacent cells in order to fill a spreadsheet. Complete the “Cost to Coop”, “Revenue Amount”, and “Item Profit” columns below! Select the pink-highlighted range and copy to the green highlighted area.

29 29 All cell entries end up being altered in the desired (row-oriented) manner


Download ppt "Numeric and Functional. A cell is the intersection of a row and column Each cell in the spreadsheet has a name – The column-name followed by the row-name."

Similar presentations


Ads by Google