Presentation is loading. Please wait.

Presentation is loading. Please wait.

Numeric and Functional

Similar presentations


Presentation on theme: "Numeric and Functional"— Presentation transcript:

1 Numeric and Functional
Spreadsheets Numeric and Functional

2 Spreadsheet Basics 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 Ranges A range denotes a block of cells. A range is typed as:
upper-left-cell:bottom-right-cell For example: A5:C7

4 Spreadsheet Basics 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 Formula 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 Cell References in Formula
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

7 Operators 10 A5 Result + 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

8 Precedence of Operators
Question: what does the following formula produce? = * 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 Precedence of Operators
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 = * 2 ^ 2 – 1 – 10 / 5 = * 4 – 1 – 10 / 5 = – 1 – 10 / 5 = – 1 – 2 =150 – 1 – 2 =149 – 2 =147

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

11 Functions Formula may also contain function calls. Function syntax is:
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).

12 Functions 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.

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) =( )/5

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

15 Relational Operators Relational operators produce logical values
=10 < 30 True =30 = 30 True =30 <> 30 False =35 > 30 True =A5 > B5 ??

16 Logical Functions 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 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) 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

18 Logical FUNCTIONS 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)

19 Conditionals 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 Conditionals 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 Conditional Example What to enter into cell E10?
=IF(B10=“PT”, 0, C10*.04)

22 Conditional Example 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 Cell References in Formula
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 Cell Reference Example
Absolute vs. Relative 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. Mixed A$3 $A3 Absolute $A$3 Relative (default) A3 Mode Cell Reference Example

25 Absolute vs. Relative =??+??
C D E 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 Absolute vs. Relative A B C D E 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 Absolute vs. Relative A B C D E 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 Using Relative References
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 Use of Relative References
All cell entries end up being altered in the desired (row-oriented) manner


Download ppt "Numeric and Functional"

Similar presentations


Ads by Google