View
9
Download
0
Category
Preview:
Citation preview
2012 Midwest SUGA Regional Training Conference
Excel – Formulas and Functions
Overview Presented by Morning Star Computer Training and Consulting
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 2 mstarcomp@comcast.net 630-717-7712
Published by Morning Star Computer Training P.O. Box 9002
Naperville, IL 60567-6733 Phone: (630) 717-7712
mstarcomp@comcast.net
Copyright © 2008 Morning Star Computer
No part of this manual may be copied, reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise without prior permission of the publisher. DISCLAIMER
Morning Star Computer Training makes a sincere effort to ensure the accuracy of this manual. However, no warranty, expressed or implied is provided. Morning Star Computer Training disclaims any responsibility or liability for any direct or indirect damages resulting from the use of the information contained in this manual.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 3 mstarcomp@comcast.net 630-717-7712
Table of Contents About calculation operators ......................................................................................................................... 4
Types of operators .................................................................................................................................... 4
Arithmetic operators ............................................................................................................................. 4
Comparison operators .......................................................................................................................... 4
Text concatenation operator ................................................................................................................ 5
Reference operators ............................................................................................................................. 5
The order in which Excel performs operations in formulas ...................................................................... 5
Operator precedence ............................................................................................................................ 5
Use of parentheses ............................................................................................................................... 6
Use Formula AutoComplete.......................................................................................................................... 6
Combine text from multiple cells into one cell, using a formula .................................................................. 7
Replace formulas with their calculated values ............................................................................................. 8
Using AutoSum .............................................................................................................................................. 9
Insert Function .............................................................................................................................................. 9
Average Function ...................................................................................................................................... 9
MIN function ........................................................................................................................................... 10
MAX function .......................................................................................................................................... 10
Using Absolute References ......................................................................................................................... 10
Database Functions ..................................................................................................................................... 11
DSum Function ........................................................................................................................................ 11
DAverage ................................................................................................................................................. 12
Dcount ..................................................................................................................................................... 13
IF Function ................................................................................................................................................... 14
Calculate the number of days between two dates ..................................................................................... 14
VLOOKUP..................................................................................................................................................... 15
Add cells to the Watch Window ................................................................................................................. 16
Avoid common errors when creating formulas .......................................................................................... 17
Formulas That Produce Error Values .......................................................................................................... 18
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 4 mstarcomp@comcast.net 630-717-7712
About calculation operators
Operators specify the type of calculation that you want to perform on the elements of a formula.
Microsoft Excel includes four different types of calculation operators: arithmetic, comparison, text,
and reference.
Types of operators
Arithmetic operators
To perform basic mathematical operations such as addition, subtraction, or multiplication;
combine numbers; and produce numeric results, use the following arithmetic operators.
Arithmetic operator Meaning (Example)
+ (plus sign) Addition (3+3)
– (minus sign) Subtraction (3–1)
Negation (–1)
* (asterisk) Multiplication (3*3)
/ (forward slash) Division (3/3)
% (percent sign) Percent (20%)
^ (caret) Exponentiation (3^2)
Comparison operators
You can compare two values with the following operators. When two values are compared by
using these operators, the result is a logical value either TRUE or FALSE.
Comparison operator Meaning (Example)
= (equal sign) Equal to (A1=B1)
> (greater than sign) Greater than (A1>B1)
< (less than sign) Less than (A1<B1)
>= (greater than or equal to sign) Greater than or equal to (A1>=B1)
<= (less than or equal to sign) Less than or equal to (A1<=B1)
<> (not equal to sign) Not equal to (A1<>B1)
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 5 mstarcomp@comcast.net 630-717-7712
Text concatenation operator
Use the ampersand (&) to join, or concatenate, one or more text strings to produce a single piece
of text.
Text operator Meaning (Example)
&
(ampersand)
Connects, or concatenates, two values to produce one continuous text value
("North"&"wind")
Reference operators
Combine ranges of cells for calculations with the following operators.
Reference
operator Meaning (Example)
: (colon) Range operator, which produces one reference to all the cells between two
references, including the two references (B5:B15)
, (comma) Union operator, which combines multiple references into one reference
(SUM(B5:B15,D5:D15))
(space) Intersection operator, which produces on reference to cells common to the
two references (B7:D7 C6:C8)
The order in which Excel performs operations in formulas
Formulas calculate values in a specific order. A formula in Excel always begins with an equal sign
(=). The equal sign tells Excel that the succeeding characters constitute a formula. Following the
equal sign are the elements to be calculated (the operands), which are separated by calculation
operators. Excel calculates the formula from left to right, according to a specific order for each
operator in the formula.
Operator precedence
If you combine several operators in a single formula, Excel performs the operations in the order
shown in the following table. If a formula contains operators with the same precedence— for
example, if a formula contains both a multiplication and division operator— Excel evaluates the
operators from left to right.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 6 mstarcomp@comcast.net 630-717-7712
Operator Description
: (colon)
(single space)
, (comma)
Reference operators
– Negation (as in –1)
% Percent
^ Exponentiation
* and / Multiplication and division
+ and – Addition and subtraction
& Connects two strings of text (concatenation)
= < > <= >= <> Comparison
Use of parentheses
To change the order of evaluation, enclose in parentheses the part of the formula to be calculated
first. For example, the following formula produces 11 because Excel calculates multiplication
before addition. The formula multiplies 2 by 3 and then adds 5 to the result.
=5+2*3
In contrast, if you use parentheses to change the syntax, Excel adds 5 and 2 together and then
multiplies the result by 3 to produce 21.
=(5+2)*3
In the example below, the parentheses around the first part of the formula force Excel to calculate
B4+25 first and then divide the result by the sum of the values in cells D5, E5, and F5.
=(B4+25)/SUM(D5:F5)
Use Formula AutoComplete To make it easier to create and edit formulas and minimize typing and syntax errors, use Formula
AutoComplete. After you type an = (equal sign) and beginning letters or a display trigger, Microsoft
Office Excel displays below the cell a dynamic drop-down list of valid functions, names, and text strings
that match the letters or trigger. You can then insert an item in the drop-down list into the formula by
using an insert trigger.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 7 mstarcomp@comcast.net 630-717-7712
Type the = (equal sign) and beginning letters or a display trigger to start Formula AutoComplete.
As you type, a scrollable list of valid items is displayed with the closest match highlighted.
Icons represent the type of entry, such as a function or table reference.
Detailed ScreenTips help you make the best choice.
Combine text from multiple cells into one cell, using a formula
Use the ampersand (&) operator or the CONCATENATE function to do this task.
Worksheet example
Note: The formula inserts a space between the first and last names by using a space enclosed within
quotation marks. Use quotation marks to include any literal text — text that does not change — in the result.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 8 mstarcomp@comcast.net 630-717-7712
Replace formulas with their calculated values
Caution When you replace formulas with their values, Microsoft Office Excel permanently removes the formulas. If you accidentally replace a formula with a value and want to restore the formula, click Undo
immediately after you enter or paste the value.
1. Select the cell or range of cells that contains the formulas.
2. Click Copy .
3. Click Paste .
4. Click the arrow next to Paste Options , and then click Values Only.
The following example shows a formula in cell D2 that multiplies cells A2, B2, and a discount derived from C2 to calculate an invoice amount for a sale. To copy the actual value instead of the formula from the cell to another worksheet or workbook, you can convert the formula in its cell to its value by doing the following:
1. Press F2 to edit the cell. 2. Press F9, and then press ENTER.
After you convert the cell from a formula to a value, the value appears as 1932.322 in the formula bar. Note that 1932.322 is the actual calculated value, and 1932.32 is the value displayed in the cell in a currency format.
Tip When you are editing a cell that contains a formula, you can press F9 to permanently replace the formula with its calculated value.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 9 mstarcomp@comcast.net 630-717-7712
Using AutoSum Add the values in a column or row by using the AutoSum button
You can use AutoSum to quickly sum a range of numbers in a column or row. Click an empty cell below a
column of numbers or to the right of a row of numbers, and then click AutoSum. Excel selects what it
determines to be the most likely range of data. Click AutoSum again to accept the range that Excel
selects, or select your own range and then click AutoSum.
Insert Function The Insert Function simplifies the task of entering complex formulas or elementary formulas. The Insert
Function helps you select a function, assemble the arguments correctly and insert the function into your
formula. As you build the formula using the Insert Function, the formula bar will display all the formula.
The Insert Function utilizes two steps to reach the desired result.
The Insert Function utilizes a prewritten formula. It supplies the equal sign
[ = ], the necessary mathematical operators and parentheses to hold the cell references.
Notes:
1. The Insert Function button looks like the button below. It is located at the far left of the formula
bar.
2. The Most Recently Used function category gives you quick access to the last 10 functions used.
Average Function Returns the average (arithmetic mean) of the arguments. For example, if the range A1:A20 contains
numbers, the formula =AVERAGE(A1:A20) returns the average of those numbers.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 10 mstarcomp@comcast.net 630-717-7712
MIN function Returns the smallest number in a set of values.
=MIN(A2:A6) Minimum of the numbers in cells A2 through A6. 2
MAX function Returns the largest value in a set of values.
=MAX(A2:A6) Maximum of the numbers in cells A2 through A6. 27
Using Absolute References Relative Referencing adjusts the cell references in the formula when the formula is copied or moved in
relation to the new cell address. Excel uses relative references by default.
Absolute References do not change when they are copied to a new location. Absolute Referencing
allows you to refer back to a specific cell no matter where the formula was copied.
For example, suppose you wish to know what percentage the first quarter sales are of the total yearly
sales. You would apply Absolute Referencing to the total yearly sales in order to copy the formula to the
second, third and fourth quarters. Then when the formula is copied, the last half of the formula stays
the same. This allows each of the other three-quarters to be divided by the yearly total, thus giving you
an accurate result.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 11 mstarcomp@comcast.net 630-717-7712
To make a cell reference Absolute, insert the dollar sign [ $ ] before the column and row reference. For
example, cell E8 would become $E$8. To place the dollar signs into a cell reference, you may manually
enter the dollar sign [ $ ] with the keyboard. Or, after typing the cell reference, press the F4 key.
Database Functions
DSum Function
Adds the numbers in a field (column) of records in a list or database that match conditions that you
specify.
Syntax
DSUM(database,field,criteria)
Database is the range of cells that makes up the list or database. A database is a list of related data in
which rows of related information are records, and columns of data are fields. The first row of the list
contains labels for each column.
Field indicates which column is used in the function. Enter the column label enclosed between double
quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the
position of the column within the list: 1 for the first column, 2 for the second column, and so on.
Criteria is the range of cells that contains the conditions that you specify. You can use any range for the
criteria argument, as long as it includes at least one column label and at least one cell below the column
label in which you specify a condition for the column.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 12 mstarcomp@comcast.net 630-717-7712
DAverage
Averages the values in a field (column) of records in a list or database that match conditions you specify.
Syntax
DAVERAGE(database,field,criteria)
Database is the range of cells that makes up the list or database. A database is a list of related data in
which rows of related information are records, and columns of data are fields. The first row of the list
contains labels for each column.
Field indicates which column is used in the function. Enter the column label enclosed between double
quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the
position of the column within the list: 1 for the first column, 2 for the second column, and so on.
Criteria is the range of cells that contains the conditions you specify. You can use any range for the
criteria argument, as long as it includes at least one column label and at least one cell below the column
label in which you specify a condition for the column.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 13 mstarcomp@comcast.net 630-717-7712
Dcount
Counts the cells that contain numbers in a field (column) of records in a list or database that match
conditions that you specify.
The field argument is optional. If field is omitted, DCOUNT counts all records in the database that match
the criteria.
Syntax
DCOUNT(database,field,criteria)
Database is the range of cells that makes up the list or database. A database is a list of related data in
which rows of related information are records, and columns of data are fields. The first row of the list
contains labels for each column.
Field indicates which column is used in the function. Enter the column label enclosed between double
quotation marks, such as "Age" or "Yield," or a number (without quotation marks) that represents the
position of the column within the list: 1 for the first column, 2 for the second column, and so on.
Criteria is the range of cells that contains the conditions that you specify. You can use any range for the
criteria argument, as long as the argument includes at least one column label and at least one cell below
the column label in which you specify a condition for the column.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 14 mstarcomp@comcast.net 630-717-7712
IF Function
The IF function returns one value if a condition you specify evaluates to TRUE, and another value if that
condition evaluates to FALSE. For example, the formula =IF(A1>10,"Over 10","10 or less") returns "Over
10" if A1 is greater than 10, and "10 or less" if A1 is less than or equal to 10.
Calculate the number of days between two dates To do this task, use the subtraction (-) operator or the NETWORKDAYS function as shown in the
following example.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 15 mstarcomp@comcast.net 630-717-7712
VLOOKUP You can use the VLOOKUP function to search the first column of a range of cells, and then return a value
from any cell on the same row of the range.
This example searches the Density column of an atmospheric properties table to find corresponding
values in the Viscosity and Temperature columns. (The values are for air at 0 degrees Celsius at sea level,
or 1 atmosphere.)
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 16 mstarcomp@comcast.net 630-717-7712
Add cells to the Watch Window 1. Select the cells that you want to watch.
To select all cells on a worksheet with formulas, on the Home tab, in the Editing group, click Find &
Replace, click Go To Special, and then click Formulas.
2. On the Formulas tab, in the Formula Auditing group, click Watch Window.
3. Click Add Watch .
4. Click Add.
5. Move the Watch Window toolbar to the top, bottom, left, or right side of the window.
6. To change the width of a column, drag the boundary on the right side of the column heading.
7. To display the cell that an entry in Watch Window toolbar refers to, double-click the entry.
Note Cells that have external references to other workbooks are displayed in the Watch Window
toolbar only when the other workbook is open.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 17 mstarcomp@comcast.net 630-717-7712
Avoid common errors when creating formulas The following table summarizes some of the the most common errors that you can make when entering
a formula and how to correct those errors:
Make sure that you… More information
Match all open and close
parentheses
Make sure that all parentheses are part of a matching pair. When you
create a formula, Excel displays parentheses in color as they are entered.
Use a colon to indicate a
range
When you refer to a range of cells, use a colon (:) to separate the reference
to the first cell in the range and the reference to the last cell in the range.
For example, A1:A5.
Enter all required
arguments
Some functions have required arguments. Also, make sure that you have
not entered too many arguments.
Nest no more than 64
functions
You can enter, or nest, no more than 64 levels of functions within a
function.
Enclose other sheet
names in single
quotation marks
If the formula refers to values or cells on other worksheets or workbooks,
and the name of the other workbook or worksheet contains a
nonalphabetical character, you must enclose its name within single
quotation marks ( ' ).
Include the path to
external workbooks
Make sure that each external reference contains a workbook name and the
path to the workbook.
Enter numbers without
formatting
Do not format numbers as you enter them in formulas. For example, even if
the value that you want to enter is $1,000, enter 1000 in the formula.
Excel – Formulas and Functions Overview
Morning Star Computer Training and Consulting Page 18 mstarcomp@comcast.net 630-717-7712
Formulas That Produce Error Values
#DIV/O! means a formula is trying to divide by zero.
#N/A means the formula refers to a value that is not available.
#NAME? means the formula uses a name that Excel does not recognize.
#NULL! means the formula specifies an invalid intersection of two areas.
#REF! means the formula refers to a cell that is not valid.
#VALUE! means the formula is using an incorrect argument or operand.
###### means the formula produces a result that is too long to fit into the cell. This is
not actually an error value, but rather an indicator that the column needs to be
widened.
A circular reference error occurs when a formula refers to the cell in which it, the formula, is entered.
When there is a circular reference error, Excel will display a warning message and display in the status
bar which cell contains the circular reference.
Recommended