Lesson 2 - Excel Functions
Transcript of Lesson 2 - Excel Functions
-
8/6/2019 Lesson 2 - Excel Functions
1/27
CSc 2 Introduction to ComputersII
Lesson 2 - Excel Functions
-
8/6/2019 Lesson 2 - Excel Functions
2/27
Using functions
A function is a pre-defined formula that helps performcommon mathematical functions.
Excel literally has hundreds of different functions to assistwith your calculations.
Building formulas can be difficult and time-consuming. Excel'sfunctions can save you a lot of time and headaches.
You could use an Excel function called Average, for example,to quickly find the average of range of numbers.
Or you could use the Sum function to find the sum of a cell
range.
Excel XP contains many different functions.
-
8/6/2019 Lesson 2 - Excel Functions
3/27
Examples of creating a function
An example of a function with one argument
that adds a range of cells, B3 through B10:
-
8/6/2019 Lesson 2 - Excel Functions
4/27
Basic Functions
SUM - summation adds a range of cells
together.
AVERAGE - average calculates the average of a
range of cells.
MAX - identifies the largest number in a range
of cells.
MIN - identifies the smallest number in a
range of cells.
-
8/6/2019 Lesson 2 - Excel Functions
5/27
Basic FunctionsSUM AVERAGE
=SUM(A1:A10)
=SUM(A1:B10,C3)
=SUM(A1:B10,D1:E10)
=AVERAGE(A1:A10)
=AVERAGE(A1:B10,C3)
=AVERAGE(A1:B10,D1:E10)
MAX MIN
=MAX(A1:A10)
=MAX(A1:B10,C3)=MAX(A1:B10,D1:E10)
=MIN(A1:A10)
=MIN(A1:B10,C3)=MIN(A1:B10,D1:E10)
-
8/6/2019 Lesson 2 - Excel Functions
6/27
TODAY() and NOW() Functions
The TODAY and NOW functions are calendar functions thatdisplay the current date and/or time.
=TODAY()
Displays current date: i.e. 4/12/10.Date displays in short date format.
=NOW()Displays current date and time:4/12/10 16:10.
Date displays in short date format and time displays in militarytime.
-
8/6/2019 Lesson 2 - Excel Functions
7/27
COUNT and COUNTA Functions
The COUNT function is used to count the
number of cells in a range that contain
numbers or values.
The COUNTA function is used to display the
number of cells in a range that contain both
text AND values.
-
8/6/2019 Lesson 2 - Excel Functions
8/27
COUNT and COUNTA Functions
=COUNT(A1:A10)Displays the number of cells that contain numbers (values).
=COUNTA(A1:B10,C3)
Displays the number of cells that contain text and values inrange A1:B10 and cell C3.
=COUNT(A1:B10,D1:E10)Displays the number of cells that contain numbers (values) in
ranges A1:B10 and D1:E10.
-
8/6/2019 Lesson 2 - Excel Functions
9/27
COUNTIF Function The COUNTIF function is used to count the number of cells in
a range that meet specific criteria. This function contains twoarguments.
COUNTIF Function Syntax=COUNTIF(Range,"Criteria")
The Range argument is the range address that will be thesubject of the count.
The Criteria argument is the specification that must be metfor the cell to be counted. The criteria argument issurrounded by quotation marks.
-
8/6/2019 Lesson 2 - Excel Functions
10/27
COUNTIF Function
=COUNTIF(A1:A10,mango")
Displays the number of cells in the range
indicated that contain the label mango.
=COUNTIF(B1:B10,">=3")
Displays the number of cells in the range
indicated that contain values greater than orequal to 3.
-
8/6/2019 Lesson 2 - Excel Functions
11/27
COUNTBLANK Function
The COUNTBLANK function is used to count thenumber of empty cells in a range.
=COUNTBLANK(A1:A10)
Displays the number of empty cells in range A1:A10.
=COUNTBLANK(B1:B10,D1:D10)Displays the number of empty cells in ranges B1:B10
and D1:D10.
-
8/6/2019 Lesson 2 - Excel Functions
12/27
IF Function
The IF function is a logical function that tests a
condition and then returns a result based on
that condition.
If the condition is TRUE, a user specified value
displays.
If the condition is FALSE, a different specified
value displays.
-
8/6/2019 Lesson 2 - Excel Functions
13/27
IF Function IF Function Syntax
IF(logical test,value if TRUE,value if FALSE)
=IF(A1>=75,"Pass","Fail")If a student's exam grade in cell A1 is greater than or equal to 70, the word Passwill display, otherwise, Fail will display. When text is the True and Falsearguments, they must be enclosed in quotation marks.
=IF(A1>50000,500,0)If the Sales amount in cell A1 exceeds $50,000, then display a bonus of $500,otherwise, show 0 for a bonus.
=IF(A1
-
8/6/2019 Lesson 2 - Excel Functions
14/27
Nested IF
Nested IF functions are a simple way to do a
complex conditional formula.
Nested IF functions allow you to use up to
seven IF functions to impose conditions.
Limited to 7 conditions only.
-
8/6/2019 Lesson 2 - Excel Functions
15/27
Sample Situation
To illustrate, let's say you have a spreadsheet thatyou use to keep track of your sales force.
The rate of commission each sales person receives isbased on the amount of sales they have generatedfor that month.
For example: From $1 to $10 earns 10% commission rate
From $11 to $100 earns 15% commission rate
Anything over $100 earns 20% commission rate
-
8/6/2019 Lesson 2 - Excel Functions
16/27
Sample Situation
Assuming the amount of sales is in column B,
starting at row 4, and that the column
containing the commission is formatted forpercentages, this is what the nested IF
function would look like:
=IF(B4
-
8/6/2019 Lesson 2 - Excel Functions
17/27
Sample Situation
Take note that the
commission rate is
formatted into
Percentage.
-
8/6/2019 Lesson 2 - Excel Functions
18/27
Sample Situation
This nested IF function says that if the cell B4
is less than or equal to 10, then put .10 in this
cell (the commission), if the cell B4 is greaterthan 10, but less than or equal to 100, then
put .15 in this cell.
If the number in cell B4 is greater than 100,then put .20 in this cell.
-
8/6/2019 Lesson 2 - Excel Functions
19/27
ROUND Function
In Excel, the ROUNDfunction returns anumber rounded to a specified number
of digits.
The syntax for the ROUNDfunction is:ROUND( number, digits )
Example using the image at the right:
=ROUND(A1, 0) would return 663
=ROUND(A1, 1) would return 662.8
-
8/6/2019 Lesson 2 - Excel Functions
20/27
ISBLANK, ISERROR Functions
The ISBLANK function can be used to check
for blank or null values.
The syntax for the ISBLANK function is:
ISBLANK ( value )
In Excel, the ISERROR function can be used to
check for error values.
The syntax for the ISERROR function is:
ISERROR ( value )
-
8/6/2019 Lesson 2 - Excel Functions
21/27
ISBLANK, ISERROR Functions
=ISBLANK(A1) would return FALSE
=ISBLANK(A2) would return TRUE
=ISBLANK("Tech on the Net") would returnFALSE
=ISERROR(A1) would return TRUE
=ISERROR(A2) would return TRUE
=ISERROR(A3) would return TRUE
=ISERROR(A4) would return FALSE
=ISERROR("Tech on the Net") would returnFALSE
=ISERROR(3/0) would return TRUE
-
8/6/2019 Lesson 2 - Excel Functions
22/27
The Function Wizard
The purpose of the function wizard is to provide you
with all of the possible Excel functions, and make
them easy to implement.
The function wizard is useful when you can notremember which function to use, or when you have
no idea which functions even exist.
Excel has 348 functions and are grouped by category
in the Function Wizard.
-
8/6/2019 Lesson 2 - Excel Functions
23/27
Sample Situation
You are working on a spreadsheet, and need to
know the monthly payment of a loan.
-
8/6/2019 Lesson 2 - Excel Functions
24/27
The Function Wizard
Click on the fx button to launch the Function
Wizard.
-
8/6/2019 Lesson 2 - Excel Functions
25/27
The Function Wizard
You understand that the
function you are looking for is
a Financial function, so you
click on the Financial function
category.
You then scroll down the list of
available functions. You run
across a function called PMT,
and you read the description.It sounds like the one you are
looking for, so you click OK.
-
8/6/2019 Lesson 2 - Excel Functions
26/27
The Function Wizard
The next window you see allows you to either manually key in all of thefunctions argument values, or simply tell Excel which cells contain theargument values.
So, we go field by field in the dialog box, and click on the corresponding
cell in the workbook that contains the argument value.
-
8/6/2019 Lesson 2 - Excel Functions
27/27
The Function Wizard
After putting all the necessary values in the argumentlist, Excel will then generate the computed result.