EIM 222 Excel Lab Manual 2021
EIM 222 Excel Lab Manual 2021
MUSEKA 2021
Page 1 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Objectives
1. Creating a workbook
2. Entering data (both text and numbers).
3. Placing borders.
4. Centering data
5. Font formatting (bold, italicize, font color and size)
6. Cell fill
7. Spell check
8. Find and replace
9. Merge and centering
In this lab you will enter data, create formulae, format and proof your Excel Worksheet.
Activity 1
Reproduce the simple spreadsheet shown Fig. L1:
Page 2 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
1. Open the Microsoft Excel application from the “Start—Programs” menu and create a new
blank workbook with file name “LastNameLab1.xls” (where LastName is YOUR last
name). Save on the desktop in a folder with your Registration Number.
Page 3 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Objectives
1. Page orientation
2. Printing a selection
3. Setting a print area
4. Adjusting page breaks
5. Setting a print area
6. Sorting data
7. Auto filters
Activity 1
In this lab you will set-up a page layout, select a print area, adjust page breaks, setting a print
area, sorting data and doing auto-filters.
1. We will use the spreadsheet you created in Lab 1 to execute steps 2 onwards.
2. Set your page to landscape layout (by default the page layout is portrait). To do so click
the Page Layout Tab. Under the Page Setup pane click the orientation icon and select
Landscape. Your page changes to landscape layout!
3. Print a selection. To do so block the area/selection of data you want to print, go to print
under the File Tab or Microsoft Office button, then select print selection under ‘Print
what’ option. Your selection will be printed.
4. Adjust your page breaks. This is more like setting up pages in Excel. By default Excel
allocates pages at random and some information might overlap into other pages and thus
during printing you will have part of a sentence or word split into two at the final print.
To avoid this you adjust page breaks. Following our spreadsheet in Lab 1, got to the
View Tab and click the page break icon under the Workbook Views pane. Your
spreadsheet gets into page break mode. By dragging the blue lines you can adjust to the
number of pages you want to have on your spreadsheet!
5. Now set a print area. To do so select cells A3 to A16, then go to Page Layout Tab and
under the Page Setup pane click the Print area drop-down then click set print area. The
area you selected A3 to A16 will have broken lines around it showing the print area.
When you go to print, under ‘Print what’ select active sheets, Excel will then print the
print area only. You can always clear the print area under the Page Layout Tab and Page
Setup pane.
6. Now let’s sort our data in alphabetical ascending order (i.e. from A to Z). To do this you
will have to block the cells of text you want sorted in this case from A4 to A25. Then
under the Data Tab go to the Sort and Filter pane then click the icon AZ with an arrow
pointing downwards to its right. A dialog box will pop up asking you to expand the
selection which means that there is data associated with your selection and should be
sorted according to your selected data and in our case its Number and Unit price, so
select expand selection and your data will be sorted with the corresponding Number and
Unit price associated with the item following the sorting. If you choose ‘Continue with
Page 4 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
current selection’ your selection will be sorted but data associated with your selection
remains in the original cell thereby distorting your data.
7. Let’s filter our data according to items that are in quantities say 10 only. To do this block
the column heading and cell below it, in our case cell B3 to B4 and still under the Data
Tab & Sort and Filter pane, click the Filter icon. You will see a drop-down button appear
in the far right of cell B3. When you click that drop-down button, deselect everything and
then select the check box for 10 and automatically your spreadsheet will only show items
with quantities of 10. (Hint: to know whether the selection of items appearing is filtered
Excel shows the row numbers in blue.) To remove the filter, click the icon again and it
de-activates filters.
Page 5 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Objectives
1. IF statement
2. Nested IF statement
Activity 1
In this lab you will use the IF statement in Excel to setup condition/s which will give a desired
output.
1. We will use the spreadsheet you created in Lab 1 to execute steps 2 onwards.
2. Let’s say you want to know whether to bargain for a discount on items with a unit price
greater than $20 in your grocery list or not, you can use the ‘IF’ statement in Excel to
show you which ones. To do this I will introduce you to entering formulae in Excel
3. Entering formulae in Excel is simple. Any formulae must be preceded by an equal sign
[for example =if(….)] in the cell you want the result to appear. So getting back to step 2
above, in cell E3 type Discount (Yes/No) then put the formula with the IF statement in
cell E4 which will decide for us whether a discount is due or not as follows:
=if(B4>20,“YES”,“NO”). This formula simply means that: check to see if cell B4 is
greater than 20, if that is true put in this cell (E4) the word YES, otherwise put the word
NO. If you still have mealie-meal as your first item you should get a result of NO in it in
cell E4.
4. The nested IF statement. This one is used to test several conditions and give a result
based on the satisfaction of those conditions. For example in calculating student grades
for a class of 50 or more, nested IF statements will save you time and minimize errors in
compiling the report. Let’s try nested IF with our grocery list in step 5.
5. We want excel to tell us whether an item is expensive, cheap, cheaper or cheapest
depending on our pocket! To do this let’s set our conditions first on paper. So we jot
down as follows:
a. if an items’ unit price is greater than or equal to $5.00, it’s expensive!.
b. if an items’ unit price is greater than or equal to $2.00, it’s cheap.
c. If an item’s unit price is greater than or equal to $1.00, it’s cheaper.
d. Otherwise it’s cheapest! Means its below $1.00
6. Then we put the above conditions in Excel language using the nested IF formula as
follows:
=if(C4>=5,”Expensive!”,if(C4>=2,”Cheap”,if(C4>=1,”Cheaper”,”Cheapest”)))
Finally to see the results of other items Auto-fill (i.e. drag the formula down to row with the last
item) and there you are!
Page 6 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Objectives
1. Goal Seek
Let’s assume you have 20 bolts in stock and want to find how much you should sell one bolt so
as to get a revenue of $111 from all of them.
Step 1
Setup your spreadsheet as shown in Fig. GST1, where Initial Value is your stock at hand, Goal
Seek Value is the selling price of each bolt which Excel will calculate for you and Desired Value
is your revenue of $111.
Note in that cell there is a zero because we put a formula not 111 and the formula for revenue is
initial value (20, which you type in) multiplied by goal seek value (leave blank).
Page 7 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Step 2
Under the data tab look for the Forecast pane and click the What-if-Analysis icon and choose
goal seek as shown in Fig. GST2.
Page 8 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Step 4
Excel finishes the calculation as shown in Fig. GST4.
Click OK to see the Goal Seek Value which is the unit price for each bolt ($5.55) to get a
revenue of $111,
Page 9 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Objective
1. Scenario Manager
Let’s assume as the Engineering Manager you want to optimise your workers so as to have a
plant availability of 121 hours at the end of the 1st quarter of the year so as to do a quarterly
maintenance shutdown.
Step 1
Setup your spreadsheet as shown in Fig. SMT1.
Utilisation is the amount of time a worker is busy (from workstudy results).
Available is the total amount of time at your disposal in that whole quarter (enter 1200).
Total hours used is the sum of utilisation hours for all workers.
Plant availability is the hours the plant is not busy or idle, that is $D$3 minus $B$12 (you enter
the formula =D3-B12 in that cell $C$13.
Page 10 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Step 2
Under the data tab locate the Forecast pane and click the What-if-Analysis icon as shown in Fig.
SMT2.
Page 11 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Step 4
The scenario manager dialogue box pops-up as shown in Fig. SMT4.
Click Add to add the current scenario which is on your current spreadsheet.
Page 12 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Step 5
The Add Scenario dialogue box pops-up as shown in Fig. SMT5.
Enter the Scenario name as Current Status.
Changing cells should be selected by clicking the red arrow at the far right of the cell and you
select $B$3, then press ctrl key to select $B$7 and $B$9. (Please note the moment you enter the
changing cells the dialogue box name changes to Edit Scenario. This is normal).
Click OK.
Page 13 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Step 6
The Scenario Values dialogue box pops-up as shown in Fig. SMT6.
By default Excel picks the values of the changing cells you selected, so you just click OK.
Page 14 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Step 7
The Scenario Manager dialogue box returns again as shown in Fig. SMT7, this time with your
current status saved.
Click Add button to add the optimised status.
Page 15 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Step 8
The Add Scenario dialogue box opens as shown in Fig. SMT8.
Under Scenario name type Optimised Status.
The rest is picked up by Excel by default, then click OK
Page 16 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Step 9
The scenario values dialogue box pops-up and this where you enter values for each of the
changing cells (workers you wish to optimise) as shown in Fig. SMT9.
These values are entered by trial and error and checking the spreadsheet to see if the availability
is now at the desired value as explained in Step 10.
In this Tutorial we enter the values 300 for Cell $B$3, 140 for Cell $B$7 and 250 for Cell $B$9.
Click OK.
Page 17 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Step 10
The Scenario Manager dialogue box pops-up again showing both the saved current and
optimised statuses as shown in Fig. SMT10.
With the Optimised Status highlighted as shown in Fig. SMT10 click show.
Page 18 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
The spreadsheet changes values of cells $B$3, $B$7, $B$9 (our changing cells) and $C$13 (our
desired plant availability). Please note you’ll have to drag the dialogue box to the right so as to
see the changes as shown in Fig. SMT10.1.
Page 19 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Step 11
Click Summary as shown in Fig. SMT11.
Page 20 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
By default the Scenario Summary radio button is selected, click OK. A new spreadsheet is
created with the tab name Scenario Summary showing your current status values and optimised
status values as shown in Fig. SMT11.2.
Page 21 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Objectives
2. VLOOKUP
3. PivotTables in Excel
Activity 1
In this Lab we will look at a special function called VLOOUP in Excel and also do PivotTables.
Enjoy!
1. Still using our example from Lab 1 we would like Excel to look for an item of grocery
say salt and tell us the unit price. That’s interesting! Let’s interest ourselves in step 2!
2. VLOOKUP is a function in excel and to get it work it must be entered in formula style
that means preceded by a ‘=’ sign. So with our item of salt in mind, go to cell F3 and type
Search Item:, then we are going to enter our VLOOKUP formula in cell F4 as follows:
a. =VLOOKUP(G3,A3:C25,3,FALSE)
This should give you a unit price associated with Salt. FALSE here means we want an
exact match, otherwise if left blank Excel will return an approximate match.
3. Once you enter Salt in cell G3, you will get the Price of Salt in cell F4.
4. PivotTables make reporting in Excel smarter and flexible. Let’s create a PivotTable for
our Grocery List. To do this:
a. Go to the Insert Tab and under the Tables pane click the PivotTable icon
b. A PivotTable dialog box will pop up prompting you to select the table/range for
your table.
c. Block the whole table from cell A2:C24 (i.e. depending in which cell ‘Item’ is
and ‘Unit Price’ is). The whole area should now be surrounded by flashing dotted
lines.
d. You can choose to create the PivotTable in a new worksheet or insert it in the
current worksheet. For this lab we will choose the default ‘New Worksheet’.
Notice your PivotTable has been created in a new worksheet, Sheet 4. And it
looks blank, of course it is blank!
e. You fill it up by dragging the fields in the PivotTable field list to the appropriate
areas below the field list, until you are satisfied with arrangement of fields.
f. You can also insert a PivotChart which changes according to changes which you
apply to the PivotTable.
Page 22 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Objectives
1. Solver
2. Macros
Activity 1
1. You have been asked to use Microsoft Excel Solver to maximize subject
to
2. To do this you should have Excel Solver added to your workbook. By default your
workbook comes without this add-in. To install this add-in, go to File-Options, Add-ins,
click Solver Add-in, then click Go next to Excel Add-ins. A dialog box for add-ins
should pop up, check the Solver Add-in and then press enter. Your solver add-in will be
installed and you can find it under the Data tab.
3. Now that you have Solver let’s look at solving the problem in step 1. The first thing is to
set-up your worksheet by setting the objective cell, decision variables cells, constraints
cells and lower bounds/non-negative cells as in Fig. L5.1:
Page 23 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
Page 24 of 25
EIM 222: Computer Applications II ENG. D. MUSEKA 2021
4. We want to create a macro that cuts the contents of cell A1 and pastes them into cell B7.
To do this ensure the developer tab is installed, if not go to Excel Options and click
customize ribbon, under the main tabs box click the Developer option and the developer
tab will be added to your Main Tabs ribbon. Now, macros as explained in the handout,
are recordings of repetitive actions done every now and then and so to save on time one
would just want to record and let excel do all the actions whilst they sit.
5. To do the task in step 4, ensure you are in cell A1 then under the Developer Tab click
record macro. A dialog box pops-up and prompts you to give a name to your macro.
Let’s give ours the name CUT then let’s use the shortcut key Ctrl+Shift+T (you do this
by pressing the Shift button on your keyboard and the letter T), then click OK. You are
now in record mode. Any action you take is now being recorded, so be careful.
6. Click cell A1 just to make sure you are there then click cut under the Home tab. Cell A1
should be flashing now. Then go to cell B7 and click the paste icon under the Home Tab,
then click the stop button positioned exactly where you clicked the record macro icon
under the Developer Tab.
7. Type ‘Jesus’ in cell A1 then press Ctrl+Shift+T and Jesus is cut and pasted to cell B7!
(Hint: Always remember your shortcut key or else go to Macros, choose the one you
want to run then click run!)
Page 25 of 25