Excel 2003

®
Excel 2003
Microsoft
Human Resources/
Learning & Development
Step by Step Instructions – Adding Formulas and Functions
What are Formulas?
What are Functions?
Formulas are equations that perform calculations on
values in your worksheet. A formula starts with an equal
sign (=).
Functions are predefined formulas that perform
calculations by using specific values, called arguments, in
a particular order, or structure. Functions can be used to
perform simple or complex calculations. For example, the
ROUND function rounds off a number in cell A10.
For example, the following formula multiplies 2 by 3 and
then adds 5 to the result.
=5+2*3
A formula can also contain any or all of the following:
functions , references, operators, and constants.
Functions: The PI() function returns the value of pi:
3.142...
References (or names): A2 returns the value in cell
A2.
Constants: Numbers or text values entered directly
into a formula, such as 2.
Operators: The ^ (caret) operator raises a number to
a power, and the * (asterisk) operator multiplies.
Commonly Used Arithmetic Operators:
Arithmetic operators are used 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)
* (asterisk)
Multiplication (3*3)
/ (forward slash)
Division (3/3)
Structure. The structure of a function begins with an
equal sign (=), followed by the function name, an
opening parenthesis, the arguments for the function
separated by commas, and a closing parenthesis.
Function name. For a list of available functions, click a
cell and press SHIFT+F3.
Arguments can be numbers, text, logical values such
as TRUE or FALSE, arrays, error values such as #N/A,
or cell references. The argument you designate must
produce a valid value for that argument. Arguments
can also be constants, formulas, or other functions.
Argument tooltip. A tooltip with the syntax and
arguments appears as you type the function. For
example, type =ROUND( and the tooltip appears.
Tooltips only appear for built-in functions.
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)
Enter a Formula:
View Formula on Status Bar:
1. Click the cell where you want to
show the result.
1. Select the cells in which
you are interested in.
2. Press = (the equal sign) to begin
any formula.
2. You will see the sum of the
range displayed on the
status bar.
3. Enter the calculations.
4. Press <Enter> or the green
checkmark.
Revised 10/2006 – Janet W Lee – [email protected] – x87771
3. Right-click the status bar.
Select another formula.
Page 1 of 4
®
Excel 2003
Microsoft
Step by Step Instructions – Adding Formulas and Functions
What Are Operators:
Use of Parentheses ( ):
•
Operator is a sign or symbol that specifies the type of
calculation to perform within an expression. There are
mathematical, comparison, logical, and reference
operators.)
•
•
If you combine several operators in a single formula,
Excel performs the operations in the following order.
()
•
→ * and /
→
+ and –
Human Resources/
Learning & Development
To change the order of calculation, 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.
=5+2*3
•
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.
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
Relative Reference: A1
A relative cell reference in a formula, such as A1, is based on the relative position of the cell that
contains the formula and the cell the reference refers to. If the position of the cell that contains the
formula changes, the reference is changed. If you copy the formula across rows or down
columns, the reference automatically adjusts. For example, if you copy a relative reference in
cell B2 to cell B3, it automatically adjusts from =A1 to =A2. Relative references are the default
type of references used in Excel.
Absolute Reference: $A$1
An absolute cell reference in a formula, such as $A$1, always refer to a cell in a specific location.
If the position of the cell that contains the formula changes, the absolute reference remains the
same. If you copy the formula across rows or down columns, the absolute reference does not adjust.
By default, new formulas use relative references, and you need to switch them to absolute
references. For example, if you copy a absolute reference in cell B2 to cell B3, it stays the same in
both cells =$A$1.
Insert a Function:
1. Select the cell you want to insert a function.
2. Do one of the following:
•
Press Shift + F3 on your keyboard; or
•
Select Insert → Function from the menu bar; or
•
Click on the Insert Function icon next to the Formula
Bar; or
•
Click the Paste Function button on the Standard toolbar.
3. Select the function you want to use. Click OK button.
4. Type in any argument, if necessary. Click OK button.
Display or Hide Zero Values:
Calculate the Difference between Two Times:
1. On the Tools menu, click Options, and then click the
View tab.
ƒ
2. Do one of the following:
ƒ
To display zero (0) values in cells, select the Zero
values check box.
ƒ
To display zero values as blank cells, clear the check
box.
Revised 10/2006 – Janet W Lee – [email protected] – x87771
Use the subtraction operator (-) to find the difference
between times, and the TEXT function to format the
times.
For example, =TEXT(B2-A2,"h:mm") produces Hours
and minutes between two times (4:55)
Page 2 of 4
®
Excel 2003
Microsoft
Human Resources/
Learning & Development
Step by Step Instructions – Adding Formulas and Functions
Copy Formulas Using Fill:
1. Click on the cell.
2. Point the mouse to the small
rectangle on the bottomright corner of the cell (fill
handle).
3. The mouse point changes to
a small black plus sign.
4. Drag the fill handle.
Move or Copy a Formula:
1.
2.
3.
Select the cell you want to copy.
On the Edit menu, click Copy.
Select the cell you
want to copy to
and do one of the
following:
• To copy the
formula and any
formatting, click
Paste.
• To copy the
formula only,
click Paste
Special →
Formulas.
NOTE: When you
move a formula, the
cell references within
the formula do not change. When you copy a formula, the
cell references may change based on the type of reference
used.
Fix Errors in Your Formulas:
##### The numeric value is too wide to display within the
cell. Resize the column by dragging the boundary between
the column headings.
#DIV/0! You tried to divide a number by zero. This error
often occurs when you create a formula that refers to a
blank cell as a divisor.
#NUM! This error occurs when you used an invalid
argument in a worksheet function.
#REF! This error occurs when a cell reference is not valid.
You probably deleted the cell range referenced to in a
formula.
#VALUE! You entered a mathematical formula that
references a text entry instead of a numerical entry.
#NAME? You entered text in a formula that Excel doesn't
recognize. You may have misspelled the name or function,
or typed a deleted name. You also may have entered text in
a formula without enclosing the text in double quotation
marks.
#N/A This error occurs when a value is not available to a
function or a formula.
TIP:
If cells contain data that is not yet available, enter
#N/A in those cells. Formulas that refer to those cells will
then return #N/A instead of attempting to calculate a
value.
Set Automatic Calculation Option:
Show or Hide Formulas:
1. Select Tools
from menu bar.
Press Ctrl + ` (above the Tab key) on your keyboard to
toggle between showing the value view and displaying the
formulas view.
2. Select Options.
3. Click on
Calculation tab.
4. Make sure
Automatic box
is checked.
5. Click on OK.
NOTE: To manually
calculate the active worksheet, press Shift + F9. To
calculate entire workbook, press F9.
Revised 10/2006 – Janet W Lee – [email protected] – x87771
Displaying Formulas
Showing Value
Page 3 of 4
®
Excel 2003
Microsoft
Step by Step Instructions – Adding Formulas and Functions
Human Resources/
Learning & Development
View Formula on Status Bar:
Differences between COUNT and COUNTA:
1. Select the cells in
which you are
interested in.
COUNTA – Counts the number of
cells that are not empty and the
values within the list of arguments.
Use COUNTA to count the number of
cells that contain data in a range or
array.
2. You will see the sum of
the range displayed on
the status bar.
3. Right-click the status
bar.
4. Select another formula.
COUNT – Counts the number of cells
that contain numbers and also
numbers within the list of arguments.
Use COUNT to get the number of
entries in a number field that's in a
range or array of numbers.
Use AutoSum:
1. Click the cell where you want to insert the total.
2. Click the AutoSum button on the Standard toolbar.
3. Verify the cell range selected by AutoSum. If it isn’t correct, highlight the cell range you want
to total.
4. Complete the formula by pressing <Enter>.
KEYBOARD SHORTCUT: Press Alt + =
Text to Column (Separate Text):
1. Highlight the cells.
2. Select Data from menu bar.
3. Select Text to Column.
4. Choose Fixed Width and Click Next.
5. Move the vertical line to adjust column width,
if necessary, and click Next.
6. Click on Finish.
NOTE: This is very handy when you have to
separate first name and last name column into
two separate columns.
Concatenate (Combine Text):
ƒ
Joins several text strings into one text string.
ƒ
You can also use the ampersand (&) calculation operator instead of the
CONCATENATE function to join text items. For example, =A1&B1 returns
the same value as =CONCATENATE(A1,B1).
1.
Click on the cell that you want to store the combined text.
2.
Click on the Insert Function icon.
3.
Select Concatenate from the function list.
4.
Click on the Text1 box and select the first cell that you want to join.
5.
Click on the Text2 box and select the 2nd cell that you want to join.
Continue with the rest of the cells if you have more.
6.
Click OK.
Revised 10/2006 – Janet W Lee – [email protected] – x87771
Page 4 of 4