Basic Excel Techniques123
Basic Excel Techniques123
Naming cells
Sumproduct function
Link
Basic Excel terminology
Worksheet operations
Naming cells
Copying formulae
IF statements
SUMPRODUCT Function
CONTENTS Basic Excel terminology
Formulae can also be composed of cell addresses. To see this note that the M1 and M2
cells contain the single numbers 3 and 5 respectively. We can sum these numbers by
entering: =M1+M2. Try it in the blue cell immediately below.
Formulae are composed of Arithmetic Operators, the most important of which are:
+ - * / ^ <
These can be combined in a variety of ways. For example to divide 3 by 5 and then add 3
we write =3/5+3 Or in terms of cell addresses =M1/M2+M1 Try both in the blue cells below.
3.6
4) Functions. These are pre-defined formulae that perform a variety of tasks and contain a numb
arguments. For example: =SUM(M1:M2) adds up the range of cells in M1 to M2 and so is equiv
to =M1+M3. Here =SUM is the function's Name and its argument inside brackets is M1:M2.
Try it in the blue cell below. NOTES 1
wn as Sheet1.
habetically labelled as
2 …..65536.
ell and has a Cell Address
can be performed
y an equals sign.
The contents of the C22 and C23 cells of this sheet are now linked to the contents of the
M1 and M2 cells of Sheet1, and will change automatically if these source values should change.
Selecting areas of the Worksheet
Areas of the worksheet can be selected with the mouse. Simply click on the first cell to be selecte
depress the left hand mouse button and drag down and along until the desired area is highlighted
This area has now been selected and can be subjected to a variety of procedures.
One of the most useful of these is Formatting. For example suppose we want to colour the
A29 to B30 range blue. Use the mouse to select the desired range, and then from the main menu
select Format and from the submenu select Cells. From the next screen select Patterns
pick blue. Try it now. NOTES 3
g and printing)
CONTENTS Saving and printing
When a new excel workbook is opened excel automatically calls the file Book1 or Book2, Book
if there is more than one file open.
Usually however we will want to supply a file name of our own.
Naming Files
To do this select File from the main menu and then select Save As.
You will be prompted for a file name so supply something appropriate and then click
This will be the workbook's file name from now on.
When you have finished working with the file do not click Save As again.
Simply select File and then Save. The workbook will be saved with the original name that you s
Creating a new file
If you want to create a new file then select File and then New and then
Printing Excel worksheets
To print the contents of a worksheet select the one to be printed. Then from the main menu sel
Click OK and the entire worksheet will be printed.
Printing a selected area of a Worksheet
Sometimes however it is only a section of the worksheet that you want to print.
To do this select the area that you want to print with the mouse. It will become highlighted.
Now select File and then Print Area and from the sub menu Set Print Area
The selected area will be all that is printed when you select print from the file menu.
Changing the print area
To alter the print area select File and then Print Area and from the sub menu select
Print preview
Finally, in order to prevent paper wastage and printing costs, it is usually best to get a print prev
This is obtained from the File menu then Print Preview.
Here you can alter the margins to accommodate data that would otherwise spill onto two pages
For example, the dotted line at the end of column I in this sheet indicates that all the text to the
would spill onto a second page.
Printing the worksheet on one page
Although it may not always be possible we can attempt to get it all onto one page by using two
from the Print Preview menu.
First, we note that by default Excel wants to print in Portrait format (longer than wide). But clea
could sometimes get more onto one page if we selected landscape (wider than long).
So from Print Preview select Setup and then change the setting to Landscape
You should find that the entire text in this sheet is now printable on one page.
If not, then you may be able to widen the margins. To do this select print preview and then
Then use the mouse to drag both the right and the left margins to the left and right.
If this fails to get it all onto one page then, if acceptable, reducing the font size might help.
To do this select the area containing the text (or the numerical data) and then click on the font s
tab on the main menu. (In this sheet it shows Arial 10). Now reduce the size and use print prev
inspect the effects.
ave As again.
ved with the original name that you supplied. NOTES 4
rinted. Then from the main menu select File and then Print.
price unit Excel allows us to Name cells and then use these names in a variety of ways.
20 10 For example, the M1 and M2 cells contain two numerical data elements (5 and 6)
200 As we have seen before we can add them together from the formula: =M1+M2
Or multiply them together from =M1*M2
Now suppose that M1 contained the price of a product and M2 contained the number of units so
Clearly the product of these two cells represents the seller's income or revenue.
So could we write something like =price*sales and get the correct answer (30)?
The answer is that we can if we use the Insert Name command,
To do this place the cursor in M1 and then select insert and then Name and then Define
At the dialogue box that should now be on screen supply the name price and click ok.
Now select M2 and repeat the process only this time supply the name sales.
To see if this has worked use the blue cell below to contain =price*sales
names can be
t of view of copying.
CONTENTS Copying formulae
€ 1.40
The previous sheet has shown the power of copying and that b
£PRICE SALES £ REVENUE € REVENUE default Excel does this in what is known a fully relative
£5.00 20 £100.00 row numbers (and column letters) are automatically
£6.00 30 £180.00 copying down or across the sheet. However, sometimes full up
£7.00 50 £350.00 is too powerful for what we require. To see this look at the data
£8.00 20 £160.00 A, B and C. This is simply the results that we obtained in Shee
£9.00 60 £540.00 However, as the header in column D indicates, we would now l
£10.00 25 £250.00 obtain the(sterling) income expressed in Euros.
£11.00 30 £330.00 To do this clearly requires an exchange rate between the poun
£12.00 40 £480.00 Euro, and we have entered this as €1.40 to the D3 cell.
Clearly the £100 revenue from the first product produces 100*€
So use the D6 cell to contain: =C6*D3
Now copy this into D7:D13.
We immediately encounter a problem as the #VALUE entries a
incorrect calculations indicate (£180 cannot possibly translate t
revenue of zero).
As a final topic in logical tests consider circumstances in which we need to test the values in
one cell. For example, suppose that in order to pass a particular subject a mark of at least 50 mu
obtained in each of two assignments.
Enter any two marks to the two yellow cells below (C24 and C25).
To test whether both C24 and C25 are greater than or equal to 50 we put each test inside bracke
and connect them with the * operator. this gives: =IF((C24>=50)*(C25>=50),"pass","fail")
MARK 1
MARK 2
Now suppose that in the example above the regulations were such that not only did both assessm
have to be at least 50, but in addition the average of the two marks had to be at least 60. It is left
exercise for you to complete the section below in line with the labels in column A.
MARK 1
MARK 2
MARK 1 + MARK 2 NOTES 7
AVERAGE MARK
VERDICT PROCEED TO SHEET 10 (Vertical Loo
sult from the logical test.
be three or four possible outcomes.
an 10 to be small and all numbers that
een 10 and 100 inclusive are to be
e three possible outcomes.
nd can be understood as follows.
of the IF statement is as follows
F statement inside the first one. that is:
ck whether the number is small or large.
neither small nor large it must be medium.
100,"large","medium"))
e possibilities.
FAIL
FAIL
CONTENTS Vertical Lookup function
It will often be the case in Data Analysis that we want to classify numerical data into categories
(Such as small, medium or large). We did this in the previous sheet with a nested IF statement.
However as the number of classification categories increases, the IF statements become increasing
complex. This is where a function known as VLOOKUP can be helpful. To appreciate its use suppos
firms with less than 16 employees are classified as small, while those with 25 or more employees a
large. Those firms with between 16 and 25 employees are classified as medium.
Now look at the data in rows 10 to 12. Given our classification criteria we have categorized each firm
as S, M or L. However in row 12 this was simply done by inspection.
Company No. 1 2 3 4 5 6 7 8
No. of employees 15 35 21 60 16 24 26 35
Category (S, M, L) S L M L M M L L
VLOOKUP category
Clearly it would be useful if we could get Excel to do this for us.
0 S The method is to use a function called =VLOOKUP which takes the
16 M arguments:
25 L 1 The value to be looked up. Clearly the first value is the one of 15
2 The table where the value is to be looked up. In this case we cre
=VLOOKUP(B12,TABLE1,2) table alongside in the A16:B18 range and we named this range as T
3 The column number of the lookup range from which we want to ge
category associated with the value being looked up. For example Ta
only two columns and the size category is in the second column. Co
the value of this argument should be 2.
Bearing these points in mind the lookup function we require is shown
A20. Enter this now as an operational formula to the B14 cell.
Then copy it along row 14 and confirm that this gives the same resu
were obtained from inspection.
There is an important point to note about the VLOOKUPfunction. The values in the first column of the defined lookup
table (Table1 in our case) must be in ascending order (as they are - 0 16 25). If this is not the case then the function must
contain an additional argument: FALSE. In other words, we would write:
=VLOOKUP(B12,TABLE1,2,FALSE)
9 10 11 12 13
15 12 19 25 50
S S M L L
11 (SUMPRODUCT Function)
#REF!
CONTENTS SUMPRODUCT Function
The yellow highlighted area contains a product's price and sales data over a period of
seven days.
DAY SALES PRICE EARNINGS The task is to calculate the total earnings for the wee
Mon 100 £10.00 First of all use D6 to contain:
Tue 125 £11.00 =B6*C6
Wed 165 £9.00 Then copy this down into D12.
Thu 120 £12.00 Next use D14 to contain:
Fri 140 £11.00 =SUM(D6:D12) An answer of £8280 wil
Sat 90 £10.00
Sun 60 £9.00 We now note however that the same answer could h
in one cell from an Excel function called =SUMPROD
TOTAL EARNINGS = The general syntax is =SUMPRODUCT(first data
SUMPRODUCT = Consequently use D15 to contain:
=SUMPRODUCT(B6:B12,C6:C12)
The same answer as before will be obtained.
It is important to note what the SUMPRODUCT funct
It multiplies each data element by its pair and then a
products.
In short, it multiplies the individual values together an
This is not the same as adding them up and then mu
together
over a period of
e will be obtained.
the SUMPRODUCT function does.
ent by its pair and then adds up these
8280
8280
CONTENTS
Explanatory comments have been added to a number of cells throughout this file. These
are indicated by a red tag is the top right corner of the cell viz:
The comment will only be visible when the mouse pointer is placed on top of the cell although you can see
all comments in the sheet by selecting view from the main menu and then comment. Repeat the process
to restore the original comment status.
A full list of all the available Excel functions along with their arguments and
their purpose can be obtained by clicking on the fx button to the left of the formula bar.
The undo button is immensely useful. Click as many times as are necessary to restore
the worksheet to its previous state. Clearly the number of clicks will depend upon the
number of things that you have done but it has a fairly long memory and can undo as many
as ten or twelve previous actions.
It is recommended that you use the save facility frequently during your work on the file.
"Save as you go along" is an important watchword. This way, if your computer crashes or
you make a catastrophic error then you will only lose the work carried out since your last save.
To express the price and income data as sterling currency we selected A6:A13 and then format and cells
from the main menu. Under the number option we selected currency and for the currency tab
selected the £ option. this was repeated for the C6:C13 range.
Placing a dollar sign in front of the row number inhibits row updating when copying
down the sheet.
Placing a dollar sign in front of the column letter inhibits column updating when copying
across the sheet.
Placing a dollar sign in front of the row number and column letter inhibits row and column updating when
copying down and across the sheet.