Sei sulla pagina 1di 26

TOPIC Sub Topic Link

ExceI preIiminaries Definitions Basic ExceI terminoIogy


Data types
Customizing Widening coIumns Rows and coIumns in Worksheets
Inserting coIumns and rows
DeIeting coIumns and rows
Sheet operations Inserting sheets Worksheet operations
Naming sheets
Linking sheets
SeIecting areas of sheets
Saving and Printing Saving and printing
Naming ceIIs Naming ceIIs
Copying (1) FuIIy reIative copying Copying formuIae
Copying (2) DoIIar fixing Copying with doIIar fixing
IF statements (1) Two outcome IF statements IF statements
IF statements (2) Nested If statements IF statements with more than two outcomes (nesting)
VIookup function Categorization VerticaI Lookup function
Sumproduct function SUMPRODUCT Function
CONTENTS Basic ExceI terminoIogy
Welcome to an Excel Workbook.
The Workbook is composed of Worksheets and this one is known as Sheet1.
A worksheet is made up of columns and rows. Columns are alphabetically labelled as
A B C.Z AA AB..BA BB....V. Rows are numbered as 1 2 ...65536.
The intersection between a row and a column is known as a Cell and has a Cell Address
denoted by its column letter and its row number - A8, B6, J12 etcetera.
By default the cells are blank but when we click on a cell to activate it and make
an entry it then contains a Data Element. COMMENT
Data elements can adopt four basic forms.
1) Text such as "average" or "score", no arithmetic operations can be performed
on text entries. They are purely for descriptive purposes.
2) Single Numbers such as 25, 56, 1234.
3) Formulae that perform arithmetic or algebraic calculations.
The crucial feature of formulae is that they must be preceded by an equals sign.
For example to add the number three to the number five we enter: =3+5
We will get the answer of eight. Try this in the blue cell immediately below.
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 number of
arguments. For example: =SUM(M1:M2) adds up the range of cells in M1 to M2 and so is equivalent
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
PROCEED TO SHEET 2 (Rows and coIumns in Worksheets)

CONTENTS Rows and coIumns in Worksheets


Widening CoIumns or Rows in worksheets
The appearance of a worksheet can be modified in a variety of ways.
For example, sometimes the result of a calculation is too large for the default
column width. When this happens excel will show ########.
To widen the column place the mouse pointer on the edge of the solid border
containing the column letters. The pointer will change from solid white to
narrow black. Now depress the left hand mouse button and drag to the right. The column will widen.
4 16 To widen several adjacent columns click on the solid column letter border and
depress the left hand mouse button. now drag to the right and a range of columns will
be selected. Now widen any one of them and you will find that they are all widened.
Inserting Rows or CoIumns in worksheets
To do this place the mouse pointer in the column or row before where you want
the insertion to be made. Then from the main menu select nsert and from the sub menu
that appears select either column or row. The insertion will be made at the cursor location.
Notice that all formulae will be updated automatically after the insertion. For example
the formula in B10 squares the value in A10 from the formula: =A10^2
Now suppose we need to insert a column at column A. Clearly what was column A will now
become column B and it might be thought that we would have to rewrite the formula as
=B10^2 This is not the case however - Excel updates it automatically. Try it for yourself by
putting the mouse pointer anywhere in column A and then insert and column from the menu.
Now place the cursor in C10 and note that the formula has updated automatically.
Now click the undo button (the blue backward pointing arrow) and the insertion will
be undone. NOTES 2
DeIeting Rows or CoIumns in worksheets
Deleting rows or columns is done from the Edit option on the main menu. Place the mouse
pointer in the column or row that you want to delete and then select Edit. From the sub menu
select Delete and then from the box that appears select either entire row or entire column.
WARNNG: deletion can be dangerous if it removes data that formulae refer to elsewhere in the
sheet. For example, place the cursor in column A then select edit, delete, entire column.
The blue cell that was in column B is now in column A and shows the error message #REF.
This is because it refers to A10 and A10 has been deleted.
Click Undo now to restore the integrity of the sheet.
PROCEED TO SHEET 3 (Worksheet operations)
CONTENTS Worksheet operations
Inserting new Worksheets to the Workbook
When you open an Excel workbook for the first time it will usually
only contain a few sheets (sometimes only one).
To add a new sheet select nsert from the main menu and then Worksheet.
Excel will add a new worksheet and give it the name Sheet2 if there is currently
only one sheet in the workbook or sheet4 if there three, etcetera.
These names however can be customized.
To do this double click on the sheet name tab at the bottom of the screen. it will become
highlighted in black and you can supply a new name of your choosing.
DeIeting Worksheets from the Workbook
Sheets can be deleted as required by selecting Edit from the main menu and then
Delete sheet. WARNNG: This can be even more dangerous than deleting rows or columns
since undo will not work. So if Excel warns you that there is data in this sheet select Cancel.
Linking workbooks
When a workbook contains more than one sheet the data in each of them can be linked.
For example suppose we want the data in M1 and M2 of Sheet1 to appear in the two blue
cells below. To do this click on the first of these (C22) now type an equals sign and then
click on the Sheet1 tab and then in M1. Press enter. Repeat the process for the C23 cell only
this time select M2 from Sheet1. Press enter.
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.
SeIecting areas of the Worksheet
Areas of the worksheet can be selected with the mouse. Simply click on the first cell to be selected,
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 and then
pick blue. Try it now. NOTES 3
PROCEED TO SHEET 4 (Saving and printing)
CONTENTS Saving and printing
When a new excel workbook is opened excel automatically calls the file Book1 or Book2, Book3 etcetera
if there is more than one file open.
Usually however we will want to supply a file name of our own.
Naming FiIes
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 Save.
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 supplied. NOTES 4
Creating a new fiIe
f you want to create a new file then select File and then New and then Save As with a new name as explained above.
Printing ExceI worksheets
To print the contents of a worksheet select the one to be printed. Then from the main menu select File and then Print.
Click OK and the entire worksheet will be printed.
Printing a seIected 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. t 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 Clear Print Area.
Print preview
Finally, in order to prevent paper wastage and printing costs, it is usually best to get a print preview.
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 in this sheet indicates that all the text to the right
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 devices
from the Print Preview menu.
First, we note that by default Excel wants to print in Portrait format (longer than wide). But clearly we
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.
f not, then you may be able to widen the margins. To do this select print preview and then Margins.
Then use the mouse to drag both the right and the left margins to the left and right.
f 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 size
tab on the main menu. (n this sheet it shows Arial 10). Now reduce the size and use print preview to
inspect the effects.
PROCEED TO SHEET 5 (Naming ceIIs)
CONTENTS Naming ceIIs 5
6
Excel allows us to Name cells and then use these names in a variety of ways.
For example, the M1 and M2 cells contain two numerical data elements (5 and 6)
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 sold.
Clearly the product of these two cells represents the seller's income or revenue.
So could we write something like =price*saIes and get the correct answer (30)?
The answer is that we can if we use the nsert 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*saIes
The advantages of Naming ceIIs
Naming cells can be useful in a variety of ways. First of all mnemonic names can be
used that are easier to remember when writing formula than M1 or M2.
Second, the name will be available under the Goto command and can help navigation and
selection of cells. The Goto command is obtained from function key 5 (F5).
Use this now and you will see all the named areas of this workbook. Simply select the one
that you want to go to and the cursor will be placed there. Try it.
Third a named cell is what is known as Absolutely Fixed from the point of view of copying.
As we will see in a later sheet this can be very useful.
PROCEED TO SHEET 6 (Copying formuIae)
CONTENTS Copying formuIae
PRCE SALES REVENUE
5 20 Excel has the ability to Copy cell data in a variety of ways and is one of its most powerful
6 30 assets. First of all, look at the data on price and sales for eight products in columns A and B.
7 50 The task is to use column C to calculate the income (or revenue) from each of the products.
8 20 The secret of copying is to write a single Source Formula that can then be copied consistently
9 60 into another area. n this case it should be clear that we want to use C4 to house this source
10 25 formula and then copy it into the C5:C11 range.
11 30 Consequently, in C4 make the entry: =A4*B4. This will calculate the income from the first
12 40 product. For the second product we .4:/ write: =A5*B5 and then =A6*B6 and so on.
But with copying there is no need for this laborious procedure.
Making sure that C4 contains our single source formula (=A4*B4) place the mouse pointer
in this source formula cell. Now notice that there is a small rectangular "blob" on the
bottom right hand corner of the cell border.
Move the mouse pointer onto this blob so that the solid white cross of the pointer becomes
narrowed and black.
When it is like this (and only when it is like this) we have activated what is known as the Handle.
f this is the case depress the left hand mouse button and drag down to C11.
The source formula in C4 will have been copied and updated so that we get =A5*B5, =A5*B5 . and
PRCE SALES REVENUE so on until =A11*B11 Try it now.
5 20
6 30 Another way of copying and achieving the same results is to use the Copy facility from the
7 50 Edit option of the main menu. To see how to do this we have replicated the data set in A21:B29.
8 20 Once again we need to write our source formula. So allowing for the new location of the
9 60 data we should use C22 to contain: =A22*B22 Make this entry now.
10 25 Next, activate the C22 source formula cell by clicking on it and the select Edit from the main
11 30 menu and then Copy. The source cell will become agitated.
12 40 Now place the mouse pointer in C23 (but do not activate the handle - just keep it in the middle
of the cell so that it is solid white). Now depress the left hand mouse button and drag down to C29.
The C23:C29 range should now be highlighted and represents the destination area into
which the source cell formula will be copied.
f this is the case select Edit from the main menu and then Paste. The copying procedure
will be effected.
PROCEED TO SHEET 7 (Copying with doIIar fixing)
CONTENTS Copying with doIIar fixing
C 1.40
The previous sheet has shown the power of copying and that by
PRCE SALES REVENUE C REVENUE default Excel does this in what is known a fully relative way. That is,
5.00 20 100.00 row numbers (and column letters) are automatically updated when
6.00 30 180.00 copying down or across the sheet. However, sometimes full updating
7.00 50 350.00 is too powerful for what we require. To see this look at the data in columns
8.00 20 160.00 A, B and C. This is simply the results that we obtained in Sheet6.
9.00 60 540.00 However, as the header in column D indicates, we would now like to
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 pound and the
12.00 40 480.00 Euro, and we have entered this as C1.40 to the D3 cell.
Clearly the 100 revenue from the first product produces 100*C1.40 = C140.
So use the D6 cell to contain: =C6*D3
Now copy this into D7:D13.
We immediately encounter a problem as the #VALUE entries and the obviously
incorrect calculations indicate (180 cannot possibly translate to a Euro
revenue of zero).
The problem stems from fully relative copying since this has updated
PRCE SALES REVENUE C REVENUE the D3 cell address to become D4, D5 etcetera. Clearly in this case we
5.00 20 100.00 do not want the D3 reference to update. We want it always to be D3.
6.00 30 180.00 Excel allows us to do this with a process known as dollar fixing (nothing to
7.00 50 350.00 do with currency).
8.00 20 160.00 To do this we attach a dollar sign in front of the row number of the D3 cell
9.00 60 540.00 reference. That is, instead of writing D3 we write D$3.
10.00 25 250.00 The data have been replicated in the A22:C30 range alongside so you should
11.00 30 330.00 enter: =C23*D$3 to the C23 cell and copy it down to D30.
12.00 40 480.00 Now it will be found that the correct results are obtained. Try it.
Lastly, select D23:D30 with the mouse, right click, select Format Cells and then Currency
and select Euro from the list.
Now recall that in Sheet5 we said that naming a cell absolutely fixes the
cell address. To see that this is equivalent to dollar fixing select the D3 cell
and then nsert Name Define and supply the name ER.
Now replace the entry in D23 (=C23*D$3) with =C23*ER and copy it into
D24:D30. the same correct answers will be obtained.
PROCEED TO SHEET 8 (IF statements)
%$
%$

CONTENTS IF statements
ConditionaI statements invoIving IogicaI tests with the IF function
Logical Tests in Excel are carried out by what is known as an Fstatement.
This is an Excel function that allows the contents of the cell in which it is housed to adopt
either of two distinct sets of values depending upon the result of the logical test.
The general construction of an if statement can be thought of as follows.
=IF(LogicaI test,ResuIt if test true,ResuIt if test faIse)
To make this general idea more specific, think of a number - any number. Now suppose that we want to
multiply this number by two if it is less than 100 but divide it by two if it is greater than or equal to 100.
We can build up the if statement that will do this as follows.
logical test is the number less than 100?
if it is then multiply the number by 2
otherwise divide the number by two
To continue enter any number of your choosing to the yellow cell below (C20).
We start with =IF(C20<100, this is the logical test.
Then we have C20*2, This the result if the test is true.
Finally we have C20/2 This is the result if the test is false
Putting the three parts together gives =IF(C20<100,C20*2,C20/2) Enter this now to the blue cell below (C21).
Now check that correct answers are returned for C20 values that
are respectively less than 100, or 100 or more.
The logical test above returned a numerical value in each of the two sets of circumstances.
However sometimes we may want a string of text to be returned. To do this we simply enclose each
of the desired text values in double quotes. For example suppose that in order to pass an examination
a minimum mark of 50 is required. Enter any mark between 0 and 100 to the yellow cell below (C28).
Now enter the following if statement to the blue cell below (C29) =IF(C28>=50,"PASS","FAIL")
Once again check your answer for marks that pass or fail.
PROCEED TO SHEET 9 (IF statements with more than two outcomes)

CONTENTS IF statements with more than two outcomes (nesting)


LogicaI tests with more than two outcomes
n the previous sheet there were only two outcomes that could result from the logical test.
However it is easy to think of circumstances in which there could be three or four possible outcomes.
For example, suppose that we define all numbers that are less than 10 to be small and all numbers that
are greater then 100 to be large. By implication all numbers between 10 and 100 inclusive are to be
classed as medium. This is clearly a three way test since there are three possible outcomes.
The if statement deals with this by a process known as Nesting and can be understood as follows.
First of all enter any number to the yellow C16 cell. The first part of the F statement is as follows
=IF(C16<10,"smaII", Now add a second F statement inside the first one. that is:
IF(C16>100,"Iarge", These two lines check whether the number is small or large.
"medium")) Consequently if it is neither small nor large it must be medium.
The full if statement is therefore =IF(C16<10,"smaII",if(C16>100,"Iarge","medium"))
Enter this now to the blue C17 cell and check out each of the three possibilities.
MY NUMBER
As a final topic in logical tests consider circumstances in which we need to test the values in more than
one cell. For example, suppose that in order to pass a particular subject a mark of at least 50 must be
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 brackets
and connect them with the * operator. this gives: =IF((C24>=50)*(C25>=50),"pass","faiI") Enter this now to C26.
MARK 1
MARK 2
Now suppose that in the example above the regulations were such that not only did both assessment marks
have to be at least 50, but in addition the average of the two marks had to be at least 60. t is left as an
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 (VerticaI Lookup function)
$

CONTENTS VerticaI Lookup function


t 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 F statement.
However as the number of classification categories increases, the F statements become increasingly
complex. This is where a function known as VLOOKUP can be helpful. To appreciate its use suppose that
firms with less than 16 employees are classified as small, while those with 25 or more employees are
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 9 10 11 12 13
No. of empIoyees 15 35 21 60 16 24 26 35 15 12 19 25 50
Category (S, M, L) S L M L M M L L S S 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 following
16 M arguments:
25 L 1 The value to be looked up. Clearly the first value is the one of 15 in B12.
2 The table where the value is to be looked up. n this case we created this
=VLOOKUP(B12,TABLE1,2) table alongside in the A16:B18 range and we named this range as Table1.
3 The column number of the lookup range from which we want to get the
category associated with the value being looked up. For example Table1 has
only two columns and the size category is in the second column. Consequently
the value of this argument should be 2.
Bearing these points in mind the lookup function we require is shown in
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 results as
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). f this is not the case then the function must
contain an additional argument: FALSE. n other words, we would write:
=VLOOKUP(B12,TABLE1,2,FALSE)
PROCEED TO SHEET 11 (SUMPRODUCT Function)
#
CONTENTS SUMPRODUCT Function
The yellow highlighted area contains a product's price and sales data over a period of
seven days.
DAY SALES PRCE EARNNGS The task is to calculate the total earnings for the week.
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 will result.
Sat 90 10.00
Sun 60 9.00 We now note however that the same answer could have been obtained
in one cell from an Excel function called =SUMPRODUCT
TOTAL EARNNGS = The general syntax is =SUMPRODUCT(first data range,second data range)
SUMPRODUCT = Consequently use D15 to contain:
=SUMPRODUCT(B6:B12,C6:C12)
The same answer as before will be obtained.
t is important to note what the SUMPRODUCT function does.
t multiplies each data element by its pair and then adds up these
products.
n short, it multiplies the individual values together and then adds them up.
This is not the same as adding them up and then multiplying the sums
together
1000
1375
1485
1440
1540
900
540
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 the1 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.
Formatting cells has a wide range of options other than patterns:
Number --- this can select the number of decimal places to show, as well as currency options
Alignment --- this allows text or numbers to be left, right, or centre justified
Font -- a wide range of font types and sizes can be chosen
Border -- solid borders can be placed around the selected area to create a boxed effect
t 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.
The entry in C34 is =C32+C33
The entry in C35 is =C34/2
The F statement in C36 is =IF((C32>=50)*(C33>=50)*(C35>=60),"PASS","FAIL")
Return to Basic ceI terminoIogy
Return to Rows and coIumns in Worksheets
Return to Worksheet operations
Return to $aving and printing
Return to opying with doIIar fiing
Return to opying with doIIar fiing
Return to statements with more than two outcomes

Potrebbero piacerti anche