PART II: FORMULAS AND FORMATS

advertisement
PART II: FORMULAS AND FORMATS
Objectives:
When you have finished Part II: Formulas and Formats you will demonstrate to your
teacher that you can perform the following tasks:
1.
2.
3.
4.
5.
6.
7.
Format cells – numeric and label
Create basic formulas
Use functions
Use AutoSum
Apply cell borders
Use the Fill commands
Cut & Paste cell information
Formatting Numbers: The Basics
You can format numbers to have similar appearance without changing their mathematical
values. For instance, the values resulting from division often have many decimals places,
which may not be aligned. If you format cells to show only two decimal places, the
results are neat and easy to read. Excel still stores all the undisplayed digits, however,
and uses them in future computations. You can redisplay complete values at any time.
An expanded formatting toolbar showing all possible buttons on this toolbar is shown
below:
Center
Font
Size
Font
Italics
Align
Left
Bold
Merge
& Center
Underline
1.
2.
3.
4.
Currency
Decrease
Style
Decimal
Align
Comma
Increase
Right
Style
Indent
Increase
Borders
Decimal
Percent
Decrease
Style
Indent
Fill
Color
Font
Color
Download the file USSales3.xls and save to your h:\Tech Applications\Excel
Folder
From your H Drive, open the file USSales3.xls
Select cell G8.
Click on the Comma Style button on the toolbar (you may need to click on
the More Buttons button to locate it) Cell G8 is formatted with two decimal
Excel Module Part 2 – page 1
5.
6.
7.
8.
places. The Comma Style button inserts commas to separate thousands, if
needed, and formats values to have two decimals.
Select cells B8 through G11.
Click on Comma Style button again. All the selected cells will be formatted.
Select cells H8 through H11.
Click on the Percent Style button. The selected cells are formatted as
percentages with no decimals.
You can use the Increase Decimal and Decrease Decimal buttons on the Formatting
toolbar to control the number of decimal places displayed in cells.
9.
10.
11.
12.
13.
14.
Select cells B17 through G20.
Click on the Decrease Decimal button. The selected cells display two
decimal places.
Click on the Increase Decimal button. The cells display three decimal places.
Select cells H17 through H20.
Click on Percent Style button and then click the Increase Decimal button.
The selected cells are displayed percentages with one decimal place.
Using the Formatting toolbar, format all the sales region numbers to match the
formatting of the “Southwest Region” numbers.
Applying Text Attributes and Cell Borders:
You can use the buttons on the Formatting toolbar to format text as well as numbers.
You can control alignment in a cell, apply bold and italic, draw lines, and change the size
of the text.
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
Select cells D1 through D3
Click on the Center button on the Formatting toolbar. The text in cells D1
through D3 is centered in the cells, but spills over to cells in column C and E.
Select cells D1 and D2.
Click the Bold button. The selected text becomes bold.
Select cells F6 through H7.
Click the Align Right button. The text is aligned with the numbers below it.
Select cells A6 through H7 and cells A11 through H11.
Click the Bold button to make the selection bold.
Apply this same table format to the other regions.
Select cells A1 through H1. This should highlight the main title and the rows
over the top of the entire tables below.
Click on the More Buttons arrow (if necessary) down at the end of the
formatting toolbar and click on the Merge and Center button.
Notice that the title is now centered over the entire set of tables below. Follow
this same procedure for row 2 for the title “5 year Sales Analysis.”
Excel Module Part 2 – page 2
You can create a line to separate data by formatting cells with a bottom border. The
easiest way to apply a border is by using the Borders button on the Formatting toolbar.
Notice the borders palette below. The default is a line on the bottom, but by clicking on
the down arrow, you have many different options to choose from.
Default Style
Single-line bottom
border style
Click arrow to
display palette
12.
13.
14.
15.
16.
17.
18.
19.
Select Cells A7 through H7.
Click on the More Button at the end of the Formatting toolbar.
Click on the Down Arrow on the right side of the Borders button and the
border palette appears.
Choose the single-line bottom border style (first row, second column) on the
palette. The bottom borders of cells A7 through H7 are formatted as a single
solid line. The Borders button default is now single-line bottom border.
Select cells A16:H16 and click the Borders button. Remember, the Borders
button uses the most recently applied border style as a default.
Apply the same border style to separate the headings from data in the other
two regions. (You will be asked to show this to your instructor during the
evaluation period.)
Make cell A1 active and save the file as USSales3.xls. The file extension will
automatically appear.
Hyperlink this assignment into your Assignment Tracker.
Creating Basic Formulas:
Formulas are instructions that tell Excel how to perform calculations. Formulas can
contain mathematical operators, values, cell references, cell ranges, and functions. Excel
performs the operations indicated in the formula in a specific order. Excel’s order of
precedence defines the order in which it performs formula operations. Parentheses are
used to override the order of operations so they are done first. Note the order that is
listed in TABLE 1 below.
Excel Module Part 2 – page 3
TABLE 1
Commonly Used
Mathematical
Operators
OPERATOR
PRECENDENCE
DESCRIPTION
ST
^
*
/
+
-
1
2ND
2ND
3RD
3RD
Exponentiate
Multiply
Divide
Add
Subtract
Used to control the order of
mathematical operations.
()
When you enter a formula you will start with an = . When you complete the formula
entry, the result of the calculation appears in the active cell, but the formula bar displays
the formula. Cell references are not case sensitive, so entering =B9+C10 is the same as
=b9+c10. Some typical formulas are shown below in TABLE 2.
TABLE 2
Typical Excel Formulas
FORMULA
=F4+F5
=c3+b3-d5
=(A3+B3)/C9
=F5*1.02
=F5*C10
1.
2.
3.
4.
5.
6.
ACTION
Adds the values in cells F4 and F5
Adds the values in cells C3 and B3
and subtracts the value in D5
Adds the values in cells A3 and B3
and then divides by the value in C9
Multiplies the value in cell F5 by
1.02 or 102%
Multiplies the value in cell F5 by
the value in cell C10
Download the file called Formula.xls.
Key your name in cell D2 and hit enter.
Save the file in your H:\Tech Applications\Excel folder as Formula.xls
From your H: Drive open the Formula.xls file.
Move to cell B12 and key =B9+B10+B11, and then press Enter. 3.662
should appear in the cell.
Press the Up Arrow to make B12 the active cell, notice that the formula
appears in the formula bar.
Excel Module Part 2 – page 4
To calculate a percentage change use multiplication to build your formula. Alpha sales
figures are only available for the years 1995-1998, but a projection must be calculated for
1999. The company is predicting that aspirin sales will decrease 5% in 1999,
acetaminophen will increase 2%, and ibuprofen sales will increase 3%.
7.
8.
9.
In cell F9 key =E9*.95, .9728 appears in cell F9. This formula is equal to 5%
less than E9, which is the projected ‘decrease’ in aspirin sales.
Move to cell F10, key =E10*1.02, and press Enter. The result 1.9788
appears in cell F10. The formula is equal to E10+E10*.02 which reflects the
2% increase in sales.
In cell F11, key =E11*1.03, and press Enter, the result is 2.29175
Using the SUM Function:
Keying individual cell references is a reasonable way to add two or three cells. It is not
practical for adding a long column or row of values, however. Excel’s SUM function
greatly simplifies the process of adding many values.
In general, the formula for a function is constructed with an equal sign and the function
name followed by a set of parentheses, with one or more cell references or values within
the parentheses.
In a SUM formula, the
STRUCTURE OF A SUM FORMULA
Parenthese
Colon
=SUM(E9:E11)
Equal Sign
1.
2.
Function Name
Cell references
cell references can consist
of a single cell or a block
of cells. Excel refers to
these references as a
range.
Technically, a
range is any group of
cells specified to be acted
upon by a command. To
identify a range, key the
cell references for two
diagonally
opposite
corners of a group of
cells, separated by a colon
Move to cell C12, key =SUM(C9:C11), and press Enter, 4.034 appears in
cell C12.
Follow this same procedure to calculate the total in column D.
The AutoSUM button is a shortcut for entering the SUM formula. It enters =SUM
and then suggests a range to total. At the bottom of a column of values, AutoSUM totals
the column. At the right of a row of values, AutoSUM totals the row.
3.
Move to cell E12, click on the AutoSUM button on the Standard toolbar. The
formula =SUM(E9:E11) appears in the formula bar and in the cell and a
moving border surrounds cells E9 through E11.
Excel Module Part 2 – page 5
4.
5.
6.
7.
Press Enter, 5.189 appears in cell E12.
If the moving border surrounds the incorrect cells, simply take your mouse
and highlight the cells you would like for your range. Pressing Esc will shut
off AutoSUM.
Sum up the three projected sales figures in Column F in cell F12.
Move to cell G12, click on the AutoSUM button, the formula
=SUM(B12:F12) appears. Press Enter. AutoSUM works in columns as well
as rows. It will look to the column of figures first to calculate a sum. If you
prefer to sum the row then you must use your mouse to change the range.
Using other Functions:
Excel also has other functions that can be used to do quick common mathematical
calculations. Average (AVERAGE), Minimum (MIN), Maximum (MAX) and Count
(COUNT) are other functions that are available and can be used in the same formula
combination as is used with SUM
1.
2.
3.
Move to cell G9, key =AVERAGE(B9:E9), which will give the average sales
that have occurred over the last four years, 1.06775 appears in cell G9.
Move to cell G10, key =MIN(B10:E10), which will return the smallest
number out of the four sales figures listed, 1.465 appears in cell G10.
Move to cell G11, key =COUNT(B11:E11), which will return the number of
cells that are in the range, 4 appears in cell G11.
Using the Fill command:
Worksheets frequently contain repetitive formulas. Instead of copying and pasting each
formula it is much easier to use a Fill command that allows you to fill formulas down a
column or across a row.
1.
2.
3.
4.
5.
6.
7.
Select cells B12 through G12, click on Edit, Clear, Contents.
Move to cell B12, use your AutoSUM to create a sum for this column.
Make sure you are on cell B12, and select cells B12 through G12.
Click on Edit, Fill, and choose Right. Move across this row of cells. Notice
that you now have the SUM formula in all of these cells with only having
typed the formula in one location.
Clear the contents in cells G9 through G12, key the formula to create a sum
calculation in cell G9, highlight these cells, and then use the Fill and Down
commands to create the same sum formulas all the way down through G12.
Close this file and save as Formula.xls in your H Drive.
Hyperlink this file in your Assignment Tracker.
Building a Worksheet with Copy and Paste:
You can copy, move and cut cell contents in Excel. A copy is an exact duplicate of the
element you select. The copy can be pasted or inserted into other locations of a
worksheet or the document area of other Windows applications. Unlike moving or
cutting, you don’t affect the original element when you copy it. The data remains in the
original location.
Excel Module Part 2 – page 6
You can choose copy and paste commands three ways:
1
2
3
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
use the Edit menu,
use the keyboard shortcuts Ctrl & C (Copy)
and Ctrl & V (Paste)
click the Copy and Paste buttons on the
Standard toolbar.
Download the file called Compare.xls
Key your name in cell G1 and hit enter.
Click the back arrow and save to your H:\Tech Applications\Excel Folder as
Compare.xls
From your H: Drive , open the file Compare.xls
Select cells A6 through B9 as the source range. The source range is the area
of the worksheet from which you copy or remove data.
Click on Edit, Copy. A moving border surrounds the selected cells. The
contents of the cells you just copied are now on the clipboard.
Select cell A11. This cell is in the upper left corner of the target range. The
target range is the new location for the data you want to copy or move.
Click on Edit, Paste. A copy of the data from the source range appears in the
target range. A copy of the data also remains on the clipboard. To show this,
Excel shows a moving border around the source range.
Press Esc to remove the moving border.
Edit cell A11 to read Women.
The Copy and Paste commands overwrite existing cell data. You can also use Copy to
insert new cells and data between existing cells
11.
12.
13.
14.
15.
16.
17.
18.
Select cells B11 to B13 and press Ctrl & C
Select cells B16 to B18 and press Ctrl & V, the months Jan through March
are replaced by April through June
Press Esc to exit Copy mode.
Select cell A16 and click on Edit, Copy
Select cell E4 and click on Insert, Copied Cells. The Insert Paste dialog box
opens.
Select Shift Cells Right and click OK. The copy of Total appears in cell E4
and the word Difference shifts one cell to the right.
Press Esc to exit Copy mode
Delete the label Difference in cell F4.
Like the Copy and Paste commands on the Edit Menu, you can use the Copy button and
the Paste button to copy cell values, formulas, and formatting.
19.
Select all cells with numbers and format them for Comma style with no
decimals.
Excel Module Part 2 – page 7
20.
21.
22.
Use the AutoSum button to total April sales for Sun Soft and Corn Silk in cell
E6.
With cell E6 selected, click the Copy button.
Select cell E7 and click on the Paste button. The formula and formatting will
be copied.
When copying formulas to new cell locations the adjustment in cell locations is referred
to as a relative cell reference. With relative referencing, when copying a formula to a
new row, your intention is to add the numbers in the new row rather than the numbers in
the original row. This type of referencing occurs with any method of copying and pasting
formulas.
23.
24.
25.
26.
27.
Select cell E8 and click Paste button.
Select cell E9 and press Enter. Excel pastes the contents and completes the
copy action, erasing the clipboard. All the copied formulas are adjusted with
relative cell references and the cell formatting is also copied.
You will have a cell which is full of ########, whenever you see this in a cell
that means there is not enough room for the number to fit in the cell. Widen
the cell so that you can see this final total.
Save your changes and save in the H:\Tech Application\Excel folder as
Compare.xls
Hyperlink this file in your Assignment Tracker.
EVALUATION – Part II
1.
2.
Download Part II Evaluation Worksheet from your teacher’s web page.
Follow the instructions.
Hyperlink your Evaluation Part II in your Assignment Tracker.
Excel Module Part 2 – page 8
Download