CHAPTER 4 - MS Excel (Module) PDF
CHAPTER 4 - MS Excel (Module) PDF
INTRODUCTION
This topic will introduce Microsoft Excel. Microsoft Excel is a popular computer
program for spreadsheet application. It features calculation, graphing tools,
pivot tables and a macro programming language called VBA (Visual Basic for
Applications).
LEARNING OBJECTIVES
LEARNING OUTCOMES
4 -1 DAC 10203
4.1.1 Standard Toolbar:
4 -2 DAC 10203
4.1.2 Formatting Toolbar:
4 -3 DAC 10203
Formula Bar
Entering Data
There are different ways to enter data in Excel: in an active cell or in the
formula bar.
To enter data in an active cell:
Figure 4.2 (b): Click the cell and type the data
4 -4 DAC 10203
Place the cursor in the Formula Bar
Type in the data
Figure 4.2(c): Click the Formula Bar And Type The Data
Excel allows you to move, copy, and paste cells and cell content through
cutting and pasting and copying and pasting.
Select Data
4 -5 DAC 10203
Cut, Copy and Paste
To insert a new blank row, place your cursor directly below where you
would like a new row. Select Insert >> Rows.
To insert a new column, place the cursor in a cell directly to the right of
where you would like the column. Select Insert >> Columns.
Place the cursor in the cell, row, or column that you want to delete
Click the Edit at the menu bar
Click Delete at the menu list
4 -6 DAC 10203
Figure 4.2.(h): Insert And Delete Rows, Columns
4 -7 DAC 10203
4.3 Add a Comment to a Cell
Click on cell B1
From the menu bar, click on Insert
From the drop down menu, click on Comment
A yellow text box will appear to the right of cell B1, as in the image
below:
Excel will add to the comment the name of the person whose computer it is. In
this case it was done on Keys computer. You can delete this name by pressing
the backspace key on your keyboard.
To add your comment, just start typing. You can enlarge the text box by holding
down your left mouse button on one of the white squares and dragging.
Click on any other cell in your spreadsheet and the comment will disappear.
The cell will have a red triangle in the top right corner, indicating that it contains
a comment.
4 -8 DAC 10203
Figure 4.3(c): Cell Contains A Comment
If you move your mouse over cell B1 the comment will pop up.
To begin this part of the course, we'll do something really simply: we'll enter
some text and numbers into some cells.
To enter something into a cell, do the following:
Click on cell egg. A1 with your left hand mouse button
4 -9 DAC 10203
Figure 4.4(a): Entering Data in a Cell
If there is already something in a cell, and you tried to type something else, the
old contents would be entirely erased.
You have to edit from the Formula bar.
Click on the cell A1. Then click inside the formula bar. You will see your cursor
flashing away.
Move your mouse pointer, the white cross, to the line in between the
A and the B
The mouse pointer will change shape again
The mouse pointer will be in the shape of a black cross with
arrowheads, like the one in the image below:
When you mouse pointer changes shape, hold down your left mouse
button
Keep it held down and drag your mouse to the right
Let go of the mouse button when you are satisfied with the width of
your column.
You can widen a row in exactly the same way. You can also double-click this
dividing line to have Excel automatically choose the best width.
There are a number of options you can select for the Horizontal text alignment.
Click on the word "Center" with your left mouse button.
Enter a number for the price, but enter a zero then a full stop first, then
the numbers
Highlight the cells
With the cells highlighted, click on Format from the menu bar
From the menu that drops down, click on "Cells"
Click on Currency from the Category section; and make sure the
Decimal Places text box has a 2 in it.
Click the OK button at the bottom.
You can change the font of your text and numbers, and make it bold. You can
also change the size of the font and the font color.
To add a splash of color to your cells, first highlight the cells you want to
change.
When you click OK, the cell color will change from white to the color or pattern
you have chosen. If you don't like it, you click on Edit from the menu bar, then
click "Undo format cell".
Once you have the numbers formatted in a different color, click on the cell A1.
The Save As dialogue box is split into three basic sections: Where do you want
to save it; the files already in that location; and what do you want to call your
file.
Just to the right of the words "Save in" is a drop down box. At the moment it
says "My Documents", and there is a little folder icon next to it. We can change
to other folder by clicking the down-pointing arrow and select the folder at the
big white area.
The File name (Book1) is already highlighted. Type a new name for our file. In
box below it- Save as type. The box says "Microsoft Excel Workbook". This is
exactly what we want, so no changes are needed. But if you click the black
down-pointing arrow, you'll see other options: Web page, Template, Text, and
so on.
But click the Save button when you've chosen a File name, and set the Save as
type to "Microsoft Excel Workbook (*.xls)".
Your new spreadsheet is saved. Keep clicking File > Save on a regular basis to
keep updating your work. Alternatively, click the Save icon on the toolbar:
The picture below shows a simple spreadsheet. There are no formulas in it, and
nothing is being added up or subtracted (we'll do that in the next section).
For Project Number 1, reproduce the spreadsheet above (the famous junk food
diet!). Your spreadsheet must include the following:
In this section, we'll construct a spreadsheet and learn about: Auto fill,
inserting rows and columns, adding up numbers in columns, formulas, and the
formula bar.
AutoFill is a very handy feature of Excel. It allows you to quickly fill a series of
data, such as days of the week, months, and consecutive numbers. You can
select list from custom list or you can create a custom fill series.
If you've already entered the list of items you want to use as a series, select the
list on the worksheet.
Note A custom list can contain text or text mixed with numbers. To
create a custom list that contains only numbers, such as 0 through 100
You cannot edit or delete the built-in lists for months and days.
To edit the list, make the changes you want in the List entries box, and then
click Add.
To delete the list, click Delete.
Click inside the cell B3 on the spreadsheet, and type the text Monday. Like this
one below
When your cursor looks like the Auto Fill one, hold down your left mouse
button and drag your mouse to the right
Drag your mouse to the cell H3, Like the one below
Let go of your left hand mouse button when your cursor is over the H3
cell
Excel will fill in the days of the week for you
Format your cells while they are highlighted (Centre and Bold)
So we've got a heading at the top of our spreadsheet, and some days of the
week headings. We can now enter the chocolate bars.
Click on cell A4 and type in the text "Mars Bars" (without the quote
marks).
Next enter Twix, Bounty and Others. In cell A9, enter the text "Day
Totals".
To enter numbers
You now need to enter the rest of the numbers. Enter the following figures for
the rest of the week:
Tuesday: 2, 5, 3, 2
Wednesday: 1, 3, 2, 2
Thursday: 3, 2, 3, 2
Friday: 3, 4, 4, 2
Saturday: 2, 2, 1, 1
Sunday: 5, 4, 4, 1
In a spreadsheet, you have to "tell" Excel which cells you want to add up. So
for the Monday column, the 1 is in cell B4, the 7 is in cell B5, the 8 is in cell B6,
and another 1 in cell B7. So we want the answer to B4 + B5 + B6 + B7.
To "tell" Excel to add up, you need an equals sign first. We'll also use the Sum
function.
You put what you want to add up in between the two brackets. So we would
need this:
=Sum( B4 + B5 + B6 + B7)
=Sum(B4: B44)
The colon means: "Add up all the cells between the one on the left and the one
on the right."
Once we have the answer in cell, we can use Auto Fill to get the answers to the
other columns or rows.
Click on cell B9
Move your mouse to the bottom right of the cell
The cursor turns into a black cross,
Hold down your left mouse button
Keep the left mouse button held down and drag your mouse towards
other cells
When your cursor gets to cell J7, let go of the left mouse button.
Excel will Auto Fill the other three cells, inserting a formula based on the
first one.
To multiply rows or column, the asterisk symbol is used. The asterisk symbol is
the one above the number 8 on your (English) keyboard.
=Product(B4:H4)
Just like the Sum function, you can add other cells after a comma. Like this:
= Product(A1:E1, A3)
= Sum(A1:A4) + A10
You can also use the Sum function alone. Like this:
= Sum(A1:A4, A10)
Here we have entered a range of cells in the brackets - A1:A4. But after that,
we added a comma then the final cell we wanted to add up. If we also wanted
to add cells A12 and A14 to our sum, we just add a comma then the cell
reference. Like this:
EXERCISE 2
You have just created a spreadsheet on Chocolate addiction. Time now to reveal your
addiction!
Create a spreadsheet like the one in the last section, but substitute Chocolate
Addiction for something else. Examples might be: drinking, eating out, clothes, and
make-up - in fact, anything that someone might be spending too much money on. (It
doesn't have to be you doing the spending; it can be entirely made up.)
Daily totals
Individual totals
Weekly total
Columns for Prices
Columns for Number and Cost
Weekly cost
Annual cost
You can format the spreadsheet any way you like. The color scheme is entirely up to
you. Just make sure that your spreadsheet is easy to follow.
4 -30 DAC 10203
4.11.3 Subtraction
To subtract one value from another, you just use the minus sign in between
your cell references. Like this:
= A1 - A2
Cell A3 is where the answer is displayed, and where we entered the formula.
If you want to subtract more than two cells you can do it like this:
= A1 - B1 - C1
4.11.4 Division
If you want to divide one number by another the symbol to use is this one:
That's the forward slash, and can be found just to the right of the full stop on
your keyboard. You use it like this:
= A1 / C1
There are times when you will want to combine the arithmetic operators in your
calculations. Here are a few examples of combining the operators:
Example 1
=(A1 + A2) * A3
The answer you should have got was 150. Notice the brackets in the formula.
The brackets group part of your sum together. Without them, Excel will
normally calculate from left to right. But it does some calculation before others.
Excel sees multiplication as more important than adding up. To see what
happens without the brackets, do this:
Click on cell A5
Click inside the formula bar at the top
Delete both the brackets from the formula
Press the return key on your keyboard to see the answer
Now the answer is different! This time you should have gotten 125. Here are
the picture versions of both formulas:
You might think the second one is wrong. But it's not. It's just the way Excel
works things out. Because it sees multiplication as more important than adding
up, it will multiply cell A2 by cell A3 first. That gets the answer of 100. Excel will
then add this answer to cell A1, which gives the answer 125.
With the brackets in, you force Excel to work things out your way. You're saying
"Do the sum in brackets first, then multiply". When you do the brackets first, you
get a different answer. A1 + A2 = 75. Multiply 75 by cell A3 and you get the
answer 150.
Substitute the asterisk symbol from example 1 with the forward slash. So the
formula will be changed from this:
= (A1 + A2) * A3
To this:
= (A1 + A2) / A3
Press the Return key on your keyboard to reveal the answer. It should be 37.5.
Now take the brackets out and try again. Again, you get a different answer. The
total will now be 50!
Again the same process is at work. Excel sees division as more important than
adding up, so it does that first. So it will divide 50 by 2 to get 25. Then it will add
the contents of cell A1 to get 50. With the brackets, we force Excel to do the
adding up first, then divide by the cell A3.
Example 3
= (A1 * A2) / A3
Press the Return key on your keyboard to reveal the answer. It should be 625.
Remove the brackets and try again. The answer should be 625 again. This is
because Excel sees Multiplication and division as being of equal importance.
When all things are equal, Excel calculates from left to right.
1) Enter the raw data below, applying as many presentation Features (Font, Font
Size, Font Color, Number Formats and Color, Cell Shading, Text Rotation, etc) to
it as you wish.
2) Apply appropriate number formats to your numbers.
3) Center your spreadsheet horizontally on the page
4) Give your spreadsheet an appropriate title and center it across your spreadsheet.
5) Select the best page orientation for your spreadsheet.
6) Adjust the column width and row height to suit the layout you have selected.
7) Create formula's to calculate totals for each month.
8) Create formula's to calculate totals for each fruit item.
9) Setup an appropriate header for this spreadsheet.
10) Setup a page number for this spreadsheet and place it in the footer.
Oranges Kiwifruit
January 4923.88 January 3349.12
February 4444.99 February 3899.87
March 3851 March 4336
April 3399.88 April 4892.01
May 3020.03 May 5217.97
June 3411.89 June 4764.10
July 3567.09 July 4523.22
August 3999.91 August 4501
September 4255.88 September 4219.91
October 4873 October 3877.49
November 5214.95 November 3712.12
December 5521.17 December 3555.56
Pears Grapes
Sorting Data in a ChartJanuary
January 3310 4847.23
February 4524.65 February 5361.58
March
In this section you'll learn how to create a chart from data5899.24
5992.76 March
in a spreadsheet.
April 6961.44 April 6853.01
You'll also learn how to sort data.
May 7447 May 5471.34
June 7583.87 June 4534.22
Before we start this7393
July
section, July
though, you need to create the spreadsheet
4222.83
below.
Type in the data7110.10
August exactly as itAugust
is in this one: 4137
September 6637.96 September 3998
October 6275 October 3556.36
November 4841.71 November 3111.44
December 3456.11 December 2789.74
Peaches Nectarines
January 5902.44 January 5310
February 7234.12 February 7772.71
March 5110 March 8219
April 3521.87 April 6989.33
May 1276.34 May 4535.52
June 1227.30 June 1873.38
July 1199.99 July 1198
August 1242.09 August 1241.63
September 1189.73 September 1187.57
October 1195.42 October 1222.21
November 1213.14 November 1432.43 DAC 10203
4 -35
December 1887.49 December 2137.78
4.13 Sorting data
The spreadsheet below shows the viewing figures for BBC 1 and ITV. The ITV
programmers have already been sorted, but the BBC programmers have not.
We'll sort the BBC programmers now.
Highlight the BBC 1 programmers and the figures. Your highlighting should look
like the one in the image below.
In the Sort By box it says "Column A". To the right of this there a Ascending
radio button and a Descending radio button. A Descending sort. Is the highest
viewing figures will be at the top and the lowest at the bottom. A Ascending sort
is the other way around, with the lowest first and the highest last.
The "Then By" boxes are for what happens in the event of a draw. You choose
which column to sort on next. But click the OK button when your dialogue box
looks like the one below:
To start making your chart, you need to highlight the data that will make up the
chart.
There is a four step process to go through with the wizard. The first step is to
select a chart type. The Chart Type showing in the image is a column chart. To
see what this will look like, click the button "Press and Hold to View Sample".
Click with the left mouse button, and keep the button held down
Let go of the left mouse button and you are returned to the chart types. The
chart we want is Bar. So click on Bar in the Chart Types list. You'll see some
different Bar types under Chart Sub Types. Make sure the first one is selected.
When you have selected your Chart sub-type, click the Next button at the
bottom, and you'll be taken to Step 2 of the Wizard.
You can click the Rows radio button and the Columns radio button to set the
data range
The Data Range is the important part of Step 2. This refers to the data that you
want in your spreadsheet. Specify a t range here and press the Next button.
Your are taken to Step 3 of the wizard, and the dialogue box now looks like the
following one:
There a whole lot for us to do in Step 3 of the Wizard! But we're basically
formatting the chart to how we want it.
Notice the three text boxes: Chart Title, Category (X) Axis, Value (Y) Axis.
Enter the text in text boxes:
From the Tab Strips along the top, click on Legend. Your dialogue box will look
something like this one:
Untick the box that says "Shows legend" to get your dialogue box looking like
the one above. Then click the Next button at the bottom. You will be taken to
Step 4 of the wizard, the final step. Your dialogue box will look like the one
below.
Move your mouse into the Chart Area, but on a white bit
Hold down your left mouse button
Keep the left mouse button held down, and drag your mouse upwards
Your chart should move up
Let go of the left mouse button when your chart is near the top
In the image below, the top left of the chart has been moved to the cell
B2
Move your mouse pointer to the middle black square on the bottom row
(if you can't see any black squares around your chart, click on the chart
with the left mouse button to select it)
Your mouse pointer will change to the shape of a arrow-headed line, like
the one in the image below:
When you mouse pointer changes to the shape above, hold down your
left mouse button
Keep your left mouse button held down and drag downwards
Let go of the mouse button when the bottom of your chart reaches about
Row 22
You can make your chart wider by moving your mouse over the right middle
black square, and then dragging outwards If you drag too, click Edit from the
menu bar, then click "Undo" from the menu.
We can make some of the Titles bold. To make your titles bold, do the
following:
Click on Viewing Figures, but click with your right mouse button
A small menu pops up
Click on Format Chart Title
Your Chart should now look something like the one below:
The P1, P2, etc, means Position 1, Position 2, and so on. The highest viewing
figure is under P1 and the lowest under P10
SUMMARY
In this topic we have studied how to create spreadsheet using MS Word. We
can also insert data and format cells. Work with mathematical calculation and
create chart.
REFERENCES