Functions
Functions
and Functions
Relative Address
Absolute Address
Functions
Decision Making in Excel
Using the If function
Examples
Slide No. 1
Relative Address
Relative addressing changes cell
addresses as you copy a formula to a
new cell
Cell Address Wrap
Example: copy the formula
=sum(A1:A4) found in A5 to D1
Result: =sum(D16381:D16384)
Cell row references wrap
Slide No. 2
Relative Address
Example - copy the formula
=sum(A1:A4) found in D6 to A6
Result: =sum(IT1:IT5)
Cell column references wrap
Slide No. 3
Absolute Address
When you want a cell address always to
refer to a specific cell or range of cells,
you must use an absolute address
Works uses a dollar sign in front of the
row or column portion of a cell address
to indicate the portion that will not
change
Slide No. 4
The Special Chars $ and ,
When entering numbers in a cell, never
add a dollar sign or comma to the
number. These are reserved for use in
formulas.
If you want them, use the formatting
option!
Slide No. 5
Mixed Address
With a mixed cell address, the row or
column can change without the other
part changing
Slide No. 6
Functions
Functions are pre-built formulas
provided by Excel (over 300 functions).
Are grouped into the following
categories:
Database Date and Time Financial
Information Logical
Lookup and Reference Math and Trig
Statistical Text
Slide No. 7
Functions
Enable you to speed up your
calculations compared to writing a
formula
For example, you could create
=(A1+A2+A3+A4+A5+A6+A7+A8)
or
use the function =SUM(A1:A8)
Slide No. 8
Understanding Functions
Functions act on data
Functions accept information, referred
to as arguments and return a result
the general syntax of a function is:
=FunctionName(arguments)
each function takes on specific types of
arguments, such as numbers,
references, text or logical values
Slide No. 9
The Function SUM
The SUM function, uses the numbers in
selected cells.
The selected cells make up the
argument portion of the function.
The argument of a function can be a
single cell, a range of cells, a named
range, or a number
Slide No. 10
Using the Wizard Function
Creating functions can seem difficult
especially with potentially different ways
of spelling a function name (AVG, AVE,
AVERAGE) and the potential number of
arguments possible
That is why Excel created the Function
Wizard
Slide No. 11
Using the Wizard Function
Select a cell where you want to enter the
function
Choose Insert->Function (or you can click the
Wizard Function Button - the fx button
Section the type of function you want from the
categories
Choose the specific function
The Wizard provides you with a series of
windows to guide your completion of the
function arguments
Slide No. 12
Slide No. 13
Slide No. 14
Slide No. 15
Decision Making in Excel
When you will be using a spreadsheet,
you will undoubtedly find situations
where the result depends on different
conditions
Excel provides a number of features to
facilitate analysis and lookups
IF() and LOOKUP()
Slide No. 16
Using the If Function
The IF function checks for certain
conditions and then takes actions
based on the results of that check
Conditions are the result of a
comparison that uses relational
operators
Slide No. 17
Relational Operators
Meaning
Operator
=
Equal to
<
Less than
>
Greater than
<> than or equal to
Less
<=
Greater than or equal to
>=
Slide No. 18
Condition
The condition lets you set up an
equation using the relational operators
to check for specific results or cell
contents
Examples:
A5 > 10, H14 = 0, D19 < 1985
The answers to these equations are
True (Yes) or False (No)
Slide No. 19
Actions
Since there are only two outcomes to a
condition, there can be only two actions
to take
1. The action to perform if the condition
is true
2. The action to perform if the condition
is false
Slide No. 20
The If Function Format
The format:
IF(condition, true action, false action)
What happens, Excel evaluates the
condition, if the condition is true, Excel
performs the true action and that’s it!
But if the condition is false, Excel
performs the false action and that’s it!
Slide No. 21
If Example
Assume that you have a spreadsheet
that calculates the commissions for the
sales representatives of a company.
Suppose that the dollar amount that a
rep has sold is in cell H5. If the sales
rep sells more than $1000, he/she gets
a commission of 10% else the
commission is 0.
Slide No. 22
If Example
Notice that we have two actions to
perform:
1. Sales * .10
2. 0
Which one we do is based on selling
over $1000.
Sales > 1000
Now we can put the IF function together
Slide No. 23
If Example
We know that “Sales” is stored in H5
and we want the commission to be
printed out in cell I5
So in cell I5 we enter the following IF
function:
=IF(H5>1000,H5 * .1,0)
Slide No. 24
Text Actions in If Functions
The IF function also lets you perform
text actions
Example:
You have a grade book spreadsheet.
Your final grade is “PASS” or “FAIL”. A
PASS is assigned for a grade greater
than or equal to 70.
=IF(D27<70,”FAIL”,”PASS”)
Slide No. 25
Text Actions
You could have also said
=IF(D27>=70,”PASS”,”FAIL”)
Note that any text to be entered in the
cell must be included in quotes
Text can also be used in the condition
part of the If function
Slide No. 26
Text Comparison in an If
Function
Suppose you ran a business that
collects sales taxes on mail orders
received only from the Makati
To check if the value of a cell (D7)
contains a state code and calculate 5%
sales tax only if the value in D7 is IN
IF(D7=“IN”,D15*.05,”No Tax”)
Slide No. 27
More Complex Decisions
You can use the logical operators: And,
Or, and Not to form more complex
conditions
You can use nested If functions to make
more complex decisions. (using an If
function in a true or false action)
Slide No. 28
AND Function
AND() function produces a TRUE
response only when all the elements
within the parentheses meet the
conditions => otherwise FALSE
When you want to check for a number
within a range => use AND
=IF(AND(D7>30,D7<61),D7,0)
Slide No. 29
OR Function
OR()function is another logical test. It
produces a TRUE response when any
one of its arguments is TRUE.
When you want to match one value
against multiple values
=IF(OR(B12=“red”,B12=“blue”),”OK”,”“)
Slide No. 30
Evaluating Complex Decisions
To make sure that your function is
evaluated correctly, you must know the
order of operations !
Slide No. 31
Evaluation Order
We have looked at the order in which
arithmetic operations are performed.
Arithmetic order of operations:
negative or positive (negation)
exponentiation
multiplication or division
addition or subtraction
Slide No. 32
Order
But where do these new
operator/functions fit in?
First in line are the logical functions -
(Not, And, OR)
Second are arithmetic operations
Finally are the relational operators
Use () when in doubt
Slide No. 33
Complex examples
=IF(H9>.894,”A”,if(H9>.794,”B”,if(H9>.6
94,”C”,if(H9>.594,”D”,”F”))))
What do you think this IF function does?
=IF(OR(D7=“IN”,D7=“In”),D15*.05,”NO
TAX”)
Slide No. 34
Other Counting Techniques
The function Countif
example:
=countif(range,criteria) =>
=countif(A1:A14,12)
counts the number of of nonempty cells
in the range (A1:A14) that meet a
specified critieria (12)
Slide No. 35
Other Countif Examples
=countif(A1:A12,1)+countif(A1:A12,12)
tallies the number of cells containing 1 or 12
=countif(A1:A12,”>=1”)-
countif(A1:A12,”<=10”)
count the number of cells that contain a value
from 1 to 10
=countif(A1:A12,”yes”)
counts the number of cells containing the
word yes
Slide No. 36
Questions
Slide No. 37