Ms Excel Notes 1
Ms Excel Notes 1
SPREADSHEETS.
Definition of a Spreadsheet.
A Spreadsheet is a ledger sheet that lets the user enter, edit, and manipulate numerical data.
A Spreadsheet usually consists of a series of rows & columns in which data entries can be made.
Types of Spreadsheets:
There are 2 types of spreadsheets:
1). Manual spreadsheet:
A Manual spreadsheet is ledger book with many sheets of papers divided into rows and
columns for entering/writing data.
The data is entered manually using a pen or pencil.
2). Electronic Spreadsheet:
A computer program that looks like the manual ledger sheet with rows & columns for
entering data that can be manipulated mathematically using of formulae.
62
Ms-Excel 2003
Examples of the commonly used Spreadsheet packages
VisiCalc – this was the 1st type of spreadsheet to be developed for PCs.
Lotus 123 – this is an integrated software with spreadsheet module, graphs, and database.
Microsoft Excel.
Corel Quattro-Pro
Microsoft Works Excel
Super calculators.
Multiplan.
Vp-Planner.
Review Questions.
1. Define a Spreadsheet.
2. Differentiate between the traditional analysis ledger sheet and an electronic spreadsheet.
3. Name three commonly spreadsheet packages.
COMPONENTS OF A SPREADSHEET
A spreadsheet has 3 main components, namely;
(a). Workbook.
(b). Database.
(c). Graphs / Charts.
Workbook:
When working in any spreadsheet program, you use workbook files to hold your information.
A Workbook is a file in a spreadsheet package that contains one or more worksheets. The
worksheets are made up of rows & columns in which you work and store your data.
A Workbook allows the user to organize various kinds of related information in a single file.
Database:
Spreadsheet programs such as Excel have special features, which can be used to manage data
values entered in the cells of the spreadsheet.
These features, which are found on the Data menu, were incorporated in Excel but they belong
to Database Management System software.
Examples of such features include: Filtering of records, use of Forms, calculating of Subtotals,
data validation, Pivot tables and Pivot chart reports.
Example:
If related data values are entered on the same row, they form a Record. Hence, a worksheet can
be manipulated as a database that has data records entered in it.
Graphs/Charts:
A Chart is a graphical/pictorial representation of data in a worksheet. Charts are used to
summarize data in a worksheet in a pictorial form.
They enable the users to present complex data elements from a worksheet in a simple format that
they can understand.
Charts make it easy for users to see comparisons, patterns, and trends in data, e.g., instead of
having to analyse several columns of a worksheet, one can see at a glance whether sales are
falling or rising.
Examples of charts are: Pie charts, Line graphs, Bar charts, Histograms, Column charts, etc.
63
Ms-Excel 2003
Review Questions.
1. Name and describe the three components of a spreadsheet.
2. Explain the following terms as used in spreadsheets.
i) Workbook.
ii) Chart.
2. Data management.
A spreadsheet enables information to be produced easily and kept up-to-date.
For example;
It enables the user to create, edit, save, retrieve and print worksheet data & records.
It enables data to be arranged neatly in tabular structure.
Related data can be typed on the same worksheet. If the data is on different worksheets,
the worksheets can be linked so that the data can be accessed easily.
Some of the data management functions include:
Sorting (i.e., arranging worksheet records in a particular order so as to easily access the
data items).
Filtering (i.e., displaying only the records that meet a given condition).
Use of Forms to enter & view records.
Use of Total/Subtotal function.
3. Scientific Applications.
Spreadsheet programs can be used by Scientists & Researchers to compile & analyse their
results.
Review Questions.
1. Explain five application areas where spreadsheet software can be used.
2. Explain the concept of “What if” analysis.
65
Ms-Excel 2003
Differences between an Electronic Spreadsheet and a Calculator
An electronic spreadsheet: -
1. Has more memory than calculator.
2. Is able to perform complex logical operations, but a calculator cannot.
3. Uses the large storage capacity of the computer that a calculator does not have.
4. Has a large working area that a calculator does not have.
Review Questions.
1. Describe any five features of a spreadsheet program.
2. State five features of spreadsheets that are useful in financial modelling.
3. How does a spreadsheet differ from a Calculator?
MICROSOFT EXCEL
This is a Spreadsheet program that enables users to create electronic worksheets that can be used
to perform simple & complex calculations using a computer.
Ms-Excel has inbuilt functions that are used as shortcuts for performing mathematical, financial
and statistical calculations.
Starting Microsoft Excel.
1. Click Start, point to Programs, then click Microsoft Excel.
-OR-
Click the Microsoft Excel icon, if it is displayed on the desktop.
WORKSHEET LAYOUT (Features/ Parts/ Elements of the Ms-Excel Screen).
(a). At the top of the window,
Title bar. It has the System /Control menu button on the left & the Resizing buttons
on the right.
Menu bar.
Toolbars, e.g., Standard & Formatting toolbars. They contain the Toolbar buttons.
Name box – displays the active cell, e.g., A1.
Formula bar: A bar at the top of the Ms-Excel window that is used to enter or edit
values or formulas in cells or charts. It also displays the constant value or formula
stored in the active cell.
To display or hide the formula bar, click Formula bar on the View menu.
(b). Column Identifiers (or Column headers) – Letters that identify the columns.
(c). Row Identifiers (or Row headers) – numbers that identify the rows.
A Worksheet has a total of 256 columns & 65,536 rows.
(d). Active (Current) cell – the cell in which the selection box (Cell pointer) is placed.
(e). Cell Pointer.
(f). Gridlines - the thin lines that indicate the cell boundaries in a worksheet.
(g). At the bottom of the window,
Status bar - displays different indicators about the current working environment.
To display or hide the Status bar, click Status bar on the View menu.
Sheet tabs – these are names of the sheets that appear at the bottom of the workbook
window.
Tab scrolling buttons - They enable the user to select and use a different sheet.
Scroll bar, scroll box & the scroll arrows.
Scroll bars are the shaded bars along the right side and bottom of a window. To scroll
to another part of the file, click the arrows in the scroll bar or drag the scroll box.
66
Ms-Excel 2003
THE WORKSHEET:
a. This is the primary document in a Spreadsheet program that is used to store & work with
data.
b. A Worksheet is a tool that is used for maintaining numeric data in a tabular form,
simplifying numerous calculations and presenting numerical data graphically.
A worksheet is basically a page stored in a workbook, and acts as the working area.
A Worksheet consists of cells that are organized into columns & rows in which data entries
are made.
Columns: – These are fields that make up the worksheet of a Spreadsheet. A Column is a
vertical arrangement of cells.
Rows: – These are records that form a worksheet. A Row is usually a horizontal
arrangement of cells.
Cell:
A box formed when a row & a column intersect in a worksheet or a table, where the data
is entered.
A cell is referred to or identified by use of the column letter heading & the row number
heading (e.g., A1 refers to the first cell).
(a).A Company Sales Report to show the sales for each item over the year.
(b).An Employees’ Payroll to calculate the employee’s salaries for each month.
(c). A Students Progress record to store information on student’s marks and monitor their
progress.
(d).Personal Expenses to maintain a budget of your monthly expenses.
(e). Mortgage Repayment Calculations to calculate the monthly repayment amount on a
mortgage loan.
Selecting worksheets.
To select Do this
A single sheet Click the tab for the sheet.
Two or more adjacent sheets Click the tab for the first sheet, hold down the
SHIFT key, then click the tab for the last sheet.
When you select a sheet, the color of its tab will
change to white.
Two or more nonadjacent sheets Click the tab for the first sheet, hold down CTRL
key, then click the tabs for the other sheets.
All sheets in a workbook Right-click a sheet tab, then click Select All Sheets
on the shortcut menu.
Note. To deselect the sheets, click inside any of the worksheets.
To Hide a worksheet.
1. Select the sheet(s) you want to hide.
2. On the Format menu, point to Sheet, then click Hide.
To Display a hidden worksheet.
1. On the Format menu, point to Sheet, then click Unhide.
2. In the Unhide sheet box, double-click the name of the hidden sheet you want to display.
Ms-Excel add-ins - Components that can be installed on your computer to add commands and
functions to Excel. These add-in programs are specific to Excel.
CREATING A NEW WORKBOOK.
To create a new, blank workbook.
1. On the File menu, click New, then click Blank Workbook on the New Workbook task
pane.
To create a new workbook based on the default workbook template.
1. Click on the New workbook icon on the Standard toolbar.
68
Ms-Excel 2003
SAVING WORKBOOKS.
Purpose.
√ In order to use the worksheet at a later time.
√ If the saving is done periodically, say every 1 minute, it helps prevent data loss in case of
power failure.
When you save a workbook for the first time, you assign a file name and indicate where you
want to store the file on your computer’s hard disk or in another location. Each time you
subsequently save the workbook, Ms-Excel updates the workbook file with your latest changes.
To save a new, unnamed workbook.
1. Click the Save button on the Standard toolbar.
-OR-
On the File menu, choose Save (or press CTRL+S) to display the Save As dialog box.
2. In the File name box, enter a name for the worksheet.
3. In the Save in list, select the drive and/or folder where you want the worksheet to be saved.
4. Click the Save button.
To save a copy of a workbook (or save a workbook with a new name).
1. Open the workbook you want to make a copy of.
2. On the File menu, click Save As….
3. In the File name box, enter a new name for the file.
To save the copy in a different folder or drive, click a different location in the Save in list.
4. Click the Save button.
To save workbooks automatically as you work.
1. On the Tools menu, click Options, click the Save tab, then select the Save AutoRecover
info every checkbox.
2. In the minutes box, enter the interval for how often you want to save files.
69
Ms-Excel 2003
Click the Open button on the Standard toolbar (or press CTRL+O) to display the Open
dialog box.
2. In the Look in drop down list, click the drive or folder that contains the file you want to
open.
3. In the folder list, locate and open the folder that contains the file.
4. Double-click the file you want to open (or click the file, and then click the Open button).
Note. To open a recently opened file, select it from the bottom of the File menu.
70
Ms-Excel 2003
Exercise (a).
1. How many columns are there in an Excel worksheet?
2. Identify and explain the FOUR types of data in Spreadsheets.
3. Explain how you would do the following operations on a Worksheet in Microsoft Excel.
(i). Rename a worksheet.
71
Ms-Excel 2003
(ii). Delete a worksheet.
(iii). Insert a single new worksheet.
(iv). Move from one worksheet to another.
(v). Select a cell.
(vi). Select a range of cells.
(vii). Select nonadjacent cells or cell ranges.
(viii). Select everything in a worksheet.
4. Define the following terms as used in Spreadsheets: (6 marks)
(i). Cell.
(ii). Formula.
(iii). Labels.
5. What is the difference between Clearing cells and Deleting cells?
Exercise (b).
1. What is the meaning of each of the following concepts?
(i). Labels.
(ii). Values.
(iii). Formula.
(iv). Function.
2. Distinguish between Labels and Formulae with respect to Spreadsheets.
Exercise (c).
1. List FOUR types of information that can be entered into a cell. (4 marks).
2. Explain THREE cell data types in spreadsheet. (6 marks).
73
Ms-Excel 2003
Method 2:
1. On the Format menu, click Cells, then click the Number tab.
2. In the Category list, click Currency, Accounting, Percentage, or Scientific.
3. In the Decimal places box, enter the number of decimal places you want to display.
If you want to change the currency symbol, click the symbol you want to use in the Symbol
list.
To Display numbers as Percentages or Fractions.
Method 1.
To quickly display nos. as percentages of 100, click the Percent Style (%) button on the
Formatting toolbar.
Method 2.
1. Select the range cells you want to format as percentages.
2. On the Format menu, click Cells, then click the Number tab.
3. To display nos. as percentages, click Percentage in the Category list. In the Decimal places
box, enter the number of decimal places you want to display.
4. To display nos. as fractions, click Fraction in the Category list, then click the type of
fraction you want to use.
74
Ms-Excel 2003
FINDING RECORDS.
Purpose.
√ Suppose you wanted to view records that meet given conditions, you would have to sort the
table according to the conditions so as to find out where those records appear in the list.
Such conditions are referred to as ‘Criteria’.
However, this method will require you to sort the table whenever you want to find something
different.
Ms-Excel offers an easier solution to this through the Filter command on the Data menu.
1. Click on any cell in the table that contains the records you want to search for.
2. On the Data menu, choose Filter, then select AutoFilter from the submenu.
A downward arrow appears on the right of each field name.
3. Click the down arrow on a column to display the conditions that can be set. Select a
condition (Criteria) from that list.
75
Ms-Excel 2003
Note. If the criteria you want is not in the list or if you want to enter two conditions, then
perform the following steps:
(i). Select the column / field to search by clicking on the down arrow to the right of the
field name.
The Custom AutoFilter dialog box appears.
(ii). In the Show rows where: box, select the conditions to use by clicking on the down
arrow. The list includes ‘is greater than’; ‘is less than’, etc.
(iii). Enter the Value to compare the contents of the field width. You could type or select it
from a drop down list of values available in the database.
4. Click the OK button to complete the task.
Note. To redisplay the records, click on the down arrow to the right of the field name that you
had selected, and select the option All.
Example:
A B C D
1 Date Person Item Amount
2 26-Jan-97 Morris Bar 95
3 28-Mar-97 Albert Take Away 136
4 28-Jan-97 Anne Lunch 53
5 09-Mar-97 Susan Breakfast 112
6 12-Jun-97 Jane Snacks 56
7 12-Apr-97 Richard Snacks 118
8 15-Mar-97 Peter Bar 114
9 25-Mar-97 Mike Take Away 80
10 01-Mar-97 James Bar 167
11 09-Jun-97 Morris Take Away 71
12 16-Jun-97 Susan Lunch 80
Suppose you want to view all the sales that exceed 100 Shillings but are below 150 shillings
from a week’s list of sales records.
The field to use for the search would be Amount. So, click on the down arrow on the right
of the Amount field.
The Operator would be is greater than, and the value would be 100.
Enter the second criteria, as Amount is less than 150, then click the OK button.
All the records whose amount is between 100 and 150 will be displayed (Only the records
matching the criteria are displayed).
A B C D
1 Date Person Item Amount
3 28-Mar-97 Albert Take Away 136
5 09-Mar-97 Susan Breakfast 112
7 12-Apr-97 Richard Snacks 118
8 15-Mar-97 Peter Bar 114
10 01-Mar-97 James Bar 167
PIVOT TABLES.
Purpose.
√ A Pivot table helps us to summarize and analyze large amounts of existing data, from a list
or table, using the format and calculation methods of your choice.
Suppose we wanted the daily totals for each of the sales persons along with the total sale for
each day: A PivotTable can help us get that kind of information much more easily.
76
Ms-Excel 2003
1. Select any cell in the list or table you want to summarize.
2. On the Data menu, select PivotTable and PivotChart Report…
3. This will activate Step 1 of the PivotTable Wizard. In this step, select the source of data Ms-
Excel will use to create the Pivot Table. From the choices given, select Microsoft Excel list
or Database.
Click on the Next button.
4. Step 2 of the Wizard shows you the range containing the list of data detected around the
position of your cell pointer of Step 1. If necessary, change the range.
Click on the Next button.
5. Click the Layout… button to specify how you want the PivotTable to appear.
6. On the right hand side of the PivotTable and PivotChart Wizard – Layout dialog box, the
Pivot Wizard shows the column titles (field names) found in your list.
Drag the field name whose contents you want to summarize downward to the area marked
ROW.
Drag the field name whose contents you want to summarize across the PivotTable to the
area marked COLUMN.
Drag the field name that contains the data to be summarized into the area marked DATA.
7. Step 3 of 3 will be displayed again allowing you to specify a convenient location for the
PivotTable. The PivotTable may be positioned either as a new worksheet or on the existing
worksheet.
If you select Existing worksheet in this dialog box, then you must specify the cell where the
top left corner of the PivotTable will be positioned.
8. To specify a name for the PivotTable, click on the Options button.
9. Click on the Finish button. Ms-Excel places the Pivot Table in the location you specified.
REFERENCING OF CELLS.
A cell is identified by use of the Column letter heading & the Row number heading.
To refer to a cell, enter the column letter followed by the row number. For example, B2 refers to
the cell at the intersection of column B & row 2.
Examples of cell references.
To refer to Type
The cell in column A & row 10 A10
77
Ms-Excel 2003
The range of cells in column A & rows 10 to 20 A10:A20
The range of cells in row 15 & columns B to E B15:E15
All cells in row 5 5:5
All cells in rows 5 to 10 5:10
All cells in column H H:H
All cells in columns H to J H:J
The range of cells in columns A to E & rows 10 to 20 A10:E20
7. Database functions.
Perform statistical calculations and queries on database tables. For instance, DSUM will find
the total of values in a particular field (column).
8. Information functions.
Return information about cells, ranges, the operating system, and some Ms-Excel tools, or to
mark places where information is missing or incorrect.
E.g., CELL - returns information about the formatting, location or contents of a cell.
CREATING MS-EXCEL FORMULAS.
Purpose.
√ When you need to perform a calculation in Ms-Excel, you use a formula.
You can create simple formulas that can be used; lets say, to add the values in two cells, or
you can create complex formulas that can calculate the Standard deviation of certain values.
For example, the formula ‘=SUM(D1:D7)’ uses a function to add the values in the range
D1:D7. It gives the same result as the formula ‘=D1+D2+D3+D4+D5+D6+D7’.
Before you write your formula in Ms-Excel, it is advisable to do the following;
(i). Decide what you want to be calculated, e.g., the Total Cost of items.
(ii). Note down the values in the worksheet required for the calculation and use them to write
down the formula, e.g. Quantity * Price.
(iii). Substitute the values with their cell references, e.g. B3*D3.
79
Ms-Excel 2003
Reference operators.
Combine ranges of cells for calculations.
Reference operator Meaning Example.
: (colon) Range operator; produces one B5:B9
reference to all the cells between
two references, including the two
references.
, (comma) Union operator; combines multiple SUM(B5:B9,D5:D9)
references into one reference.
Text concatenation operators.
Use the ampersand (&) to join one or more strings to produce a single piece of text.
Text operator Meaning Example.
& (ampersand) Connects two values to produce “North” & “wind” produces
one continuous text value “Northwind”
Creating a simple formula.
A Formula in Ms-Excel always begins with an equal (=) sign. Ms-Excel uses this sign to
differentiate between a Label (text) and a Formula. The equal sign tells Ms-Excel that the
characters that follow constitute a formula.
Following the equal sign are the elements to be calculated called Operands or Arguments. The
Arguments are separated by calculation operators, and enclosed by an opening & closing
parentheses (brackets).
1. Click on the cell in which you want to enter the formula.
2. Type the = (equal sign) to activate the Formula bar. The equal sign (=) tells Ms-Excel that
you are entering a formula in the cell.
3. Type the formula directly into the Formula box.
To tell Ms-Excel where to find the data that will be used in the calculation, type a cell
reference.
4. Press the ENTER key. Ms-Excel immediately calculates & shows the result in the cell,
while the formula is displayed in the Formula bar.
Notes.
A Formula can refer to other cells on the same worksheet.
Ms-Excel calculates a formula from left to right, according to a specific order for each
operator in the formula.
You can change the order of operations by using parenthesis. E.g., to calculate B4+25, then
divide the result by the sum of the values in cells D5, E5 and F5, the formula would be:
=(B4+25)/SUM(D5:F5)
In this example, the parentheses around the first part of the formula forces Ms-Excel to
calculate B4+25 first, then divide the result by the sum of the values in cells D5, E5, and F5.
Creating a formula that contains a function.
1. Click the cell where the result of the formula will be displayed.
2. On the Insert menu, click Function, (or click the Paste Function button on the toolbar).
3. Click a function from the Function Category list. When you select a function, a description
of the function appears in the dialog box.
Click the OK button.
4. Type in the arguments to compute in the parentheses in the formula. To enter a range, use a
Colon to separate the first & the last cells in the range, or use a Comma to separate reference
to individual cells.
80
Ms-Excel 2003
5. After you complete the formula, click the OK button or press the ENTER key.
Note. The structure of a function begins with an Equal sign (=), followed by the Function
name, & the Arguments for the function. The Arguments are separated by commas or a colon,
and enclosed in an opening & closing parenthesis.
Example 2:
A B
1 Salesperson Invoice
2 Buchanan 15,000
3 Buchanan 9,000
4 Suyama 8,000
5 Suyama 20,000
6 Buchanan 5,000
7 Dodsworth 22,500
Formula Adds
=SUM(B2:B4) the values in cells B2, B3 and B4.
=SUM(B2:B3, B5) two invoices from Buchanan, & 1 from Suyama
=SUM(B2,B5,B7) individual invoices from Buchanan, Suyama,& Dodsworth.
SUBTRACTING NUMBERS.
Type the formula ‘=10-5’ in a cell to display the result 5.
81
Ms-Excel 2003
Example: cells A2, A3 & A4 contain the values 15,000, 9,000 & -8,000.
Formula Description Result
=A2-A3 Subtracts 9,000 from 15,000 6,000
=SUM(A2:A4) Adds all nos. in the list, including negative nos. 16,000
MULTIPLYING NUMBERS.
Use the asterisk (*) operator or the PRODUCT function.
PRODUCT multiplies all the nos. given as arguments and returns the product.
Syntax: PRODUCT(number1,number2,…..)
Number1,number2,… are the numbers you want to multiply.
Formula Description Result
=5*10 50
=A2*B2 multiplies the contents in cells A2 and B2.
=(5+2)*3 adds 5 and 2 together then multiplies the result by 3 21
82
Ms-Excel 2003
Example: Using the values shown in the worksheet below, calculate the cost of the milk.
A B C D
1 Item Quantity Price Total cost
2 Milk 26 Litres 15.00
3 Sugar 19 Kgs 48.90
The Total cost of the milk will be given by, Quantity* Price. Therefore, in cell D2, type the
formula; =B2*C2.
Note. If you omit ‘=’ symbol before B2, Ms-Excel will not recognize it as a formula and what
you have typed will literally appear as ‘B2*C2’, which will not yield the expected result.
To Multiply numbers in different cells using a formula.
Cells A2, A3 & A4 contain the values 5, 15, 30.
To multiply Formula
The numbers in cells A2 & A3 =A2*A3
All the numbers in the range =PRODUCT(A2:A4)
All the numbers in the range, and 2. =PRODUCT(A2:A4,2)
DIVIDING NUMBERS.
Type a formula such as =10/5 in a cell to display the result 2.
Example.
Cells A2 & A3 contain values 15,000 and 12.
Formula Description Result
=A2/A3 Divides 15,000 by 12 1,250
The FV Function
FV calculates the future value of a fixed investment earning a fixed interest over a specified
period.
E.g., let’s say, you want to plan for your retirement in 20 years and decide to invest Ksh. 20,000
each year. If the investment pays 20% interest compounded annually, the formula would be:
=FV(20%,20,-20000)
You would collect Ksh. 3,733,760 after 20 years.
ROUNDING OF NUMBERS.
The ROUND function rounds a given number to a specified no. of digits.
Syntax: ROUND(number,num_digits)
Number –is the no. you want to round.
num_digits – specifies the no. of digits to which you want to round the no.
Notes.
If num_digits is greater than 0 (zero), then number is rounded to the specified no. of decimal
places.
If num_digits is 0 (zero), the number is rounded to the nearest Integer (whole no.).
If num_digits is less than 0 (zero), then number is rounded to the left of the decimal point.
Example 1:
Formula Description Result
=ROUND(2.15,1) 2.2
=ROUND(2.149,1) 2.1
=ROUND(21.5,-1) num_digits is less than 0 (zero), 20
Example 2: Cells A2:A4 contain values 20.3, 5.9 and -5.9.
Formula Description Result
=ROUND(A2,0) Rounds 20.3 down, because the fractional part is less than .5 20
=ROUND(A3,0) Rounds 5.9 up, because the fractional part is greater than .5 6
=ROUND(A4,0) Rounds -5.9 down, because the fractional part is less than -.5 -6
=ROUND(-1.475,2) -1.48
84
Ms-Excel 2003
To Round a number to a near fraction.
For Example, cells A2 & A3 contain values 1.25 and 30.452.
Formula Description Result
=ROUND(A2,1) Rounds the no. to the nearest 1 decimal place.
Because the portion to be rounded is 0.05 or greater,
the no. is rounded up 1.3
=ROUND(A3,2) Rounds the no. to the nearest 2 decimal places.
Because the portion to be rounded, 0.002, is less than 0.005,
the no. is rounded down 30.45
85
Ms-Excel 2003
SIN - Gives the sine of the given angle.
Syntax: SIN(number)
Number -is the angle in radians for which you want the sine. If your argument is in degrees,
multiply it by PI()/180 to convert it to radians.
Description Formula Result in radians.
Sine of pi/2 radians =SIN(PI()/2) 1
Sine of 30 degrees =SIN(30*PI()/180) 0.5
TRUNC – Truncates (shortens) a number to an Integer by removing the fractional part of the
number.
Syntax: TRUNC(number,num_digits)
Number -is the number you want to truncate.
Num_digits -is a number specifying the precision of the truncation.
Description Formula Result
Integer part of 8.9 =TRUNC(8.9) 8
Integer part of -8.9 =TRUNC(-8.9) -8
86
Ms-Excel 2003
Example: Cells A2:A6 contain values 10, 7, 9, 27 & 2.
Description Formula Result
Largest number in the range =MAX(A2:A6) 27
Smallest number in the range =MIN(A2:A6) 2
Largest of the numbers in cells A2:A6, and 30 =MAX(A2:A6, 30)
Smallest of the numbers given, and 0 =MIN(A2:A6,0)
CALCULATE THE MEDIAN OF A GROUP OF NUMBERS.
Median is the value at the center of an ordered range of nos.
Use the MEDIAN function. MEDIAN gives the number in the middle of a set of numbers.
Syntax: MEDIAN(number1,number2,...)
Number1, number2, ... are numbers for which you want the median.
Notes.
Cells with the value zero are included.
If there is an even number of nos. in the set, then MEDIAN calculates the average of the two
numbers in the middle.
Example: Cells A2:A7 contain values 1, 2, 3, 4, 5 and 6.
Description Formula
Median of the first 5 nos. in the list =MEDIAN(A2:A6)
Median of all the nos. given, or the average of 3 and 4 =MEDIAN(A2:A7)
MODE - Gives the most frequently occurring, or repetitive, value in a range of data.
Syntax: MODE(number1,number2,...)
Number1, number2, ... are the arguments for which you want to calculate the mode.
Note.
Cells with the value zero are included.
If the data set contains no duplicate data points, MODE returns the #N/A error value.
Example: Cells A2:A7 contain the values 5.6, 4, 4, 3, 2, and 4.
Description Formula
Mode, or most frequently occurring no. in the list =MODE(A2:A7)
Tip. In a set of values, the Mode is the most frequently occurring value; the Median is the
middle value; and the Mean is the average value.
87
Ms-Excel 2003
Formula Description Result
=COUNT(A2:A6) Counts no. of cells that contain nos. in the list 3 (date is a number).
=COUNT(A2:A3,A6) Counts no. of cells that contain nos. in cells 2
A2:A3, & A6
Example 2.
A
1 Sales
2 12/8/90
3
4 19
5 22.24
6 TRUE
7 #DIV/0!
Formula Description Result
=COUNT(A1:A7) Counts the no. of cells that contain nos. in the list 3
=COUNT(A5:A7) Counts the no. of cells that contain nos. in the last 3 rows
of the list 1
=COUNT(A1:A7,2) Counts the no. of cells that contain numbers in the list,
and the value 2 4
LOGICAL FUNCTIONS
Logical functions can be used either to test whether a condition is TRUE or FALSE or to check
for multiple conditions.
For example, use the IF function to determine whether a condition is true or false. One value is
returned if the condition is TRUE, and a different value is returned if the condition is FALSE.
NOT -Reverses the value of its argument. Use NOT when you want to make sure a value is not
equal to one particular value.
If logical is FALSE, NOT returns TRUE; if logical is TRUE, NOT returns FALSE.
Syntax: NOT(logical)
Logical - is a value or expression that can be evaluated to TRUE or FALSE.
Formula Description Result
=NOT(FALSE) Reverses FALSE TRUE
=NOT(1+1=2) Reverses an equation that evaluates to TRUE FALSE
AND - Returns TRUE if all its arguments are TRUE; returns FALSE if one or more argument is
FALSE.
Syntax: AND(logical1,logical2, ...)
Logical1, logical2, .. are the conditions you want to test that can be either TRUE or FALSE.
Note. The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments
must be references that contain logical values. If the specified range contains no logical values,
AND returns the #VALUE! error value.
Example 1.
Formula Description Result
=AND(TRUE, TRUE) All arguments are TRUE TRUE
=AND(TRUE, FALSE) One argument is FALSE FALSE
=AND(2+2=4, 2+3=5) All arguments evaluate to TRUE TRUE
88
Ms-Excel 2003
Example 2. Cells A2:A3 contain values 50 and 104.
If A2 contains a number between 1 and 100, then:
Formula Result
=AND(1<A2,A2<100) TRUE
Suppose you want to display A3 if it contains a number strictly between 1 and 100, and you want
to display a message if it is not. If A3 contains 104, then:
Formula Result
=IF(AND(1<A3,A3<100), A3,"The value is out of range.") “The value is out of range”.
If A3 contains 50, then:
Formula Description Result
=IF(AND(1<A2, A2<100), A2, "The value is out of range.") 50, because A3 it
between 1 & 100.
OR - Returns TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.
Syntax: OR(logical1,logical2,...)
Logical1,logical2,... are conditions you want to test that can be either TRUE or FALSE.
Notes.
The arguments must evaluate to logical values such as TRUE or FALSE, or references that
contain logical values. If the specified range contains no logical values, OR returns the
#VALUE! error value.
If a reference argument contains text or empty cells, those values are ignored.
Formula Description Result
=OR(TRUE) One argument is TRUE TRUE
=OR(1+1=1,2+2=5) All arguments evaluate to FALSE FALSE
=OR(TRUE,FALSE,TRUE) At least one argument is TRUE TRUE
Example:
Cells A2, A3 & A4 contain the values 15, 9, and 8.
Formula Description Result
=AND(A2>A3, A2<A4) Is 15 greater than 9 and less than 8? FALSE
=OR(A2>A3, A2<A4) Is 15 greater than 9 or less than 8? TRUE
=NOT(A2+A3=24) Is 15 plus 9 not equal to 24? FALSE
RELATIVE REFERENCES
When you create a formula, cells or ranges of cells will be referred to based on their position
relative to the cell that contains the formula. If cell B6 contains the formula =A5; Ms-Excel
finds the value one cell above and one cell to the left of B6.
If the position of the cell that contains the formula changes, the reference is changed.
A Relative reference is a cell reference, which changes automatically when the formula is
copied to another cell or range. It describes the location of a cell in terms of its distance (in rows
and columns) from another cell.
Note. When you copy a formula containing relative references down or across from one cell to
another, Ms-Excel adjusts the references in the pasted formula automatically to refer to a
different cell that is the same no. of rows & columns away from the formula.
Example 1:
If the formula in cell B6 (i.e., =A5) (which is one cell above & one cell to the left of B6) is
copied to cell B7. Ms-Excel will adjust the formula in cell B7 to =A6, which refers to the cell
that is one cell above and one cell to the left of cell B7.
Example 2:
If cell A3 contains the formula =A1+A2, and you copy cell A3 to cell B3, the formula in cell B3
becomes =B1+B2.
ABSOLUTE REFERENCES.
In a formula, an Absolute cell reference is the exact address of a cell, regardless of the position
of the cell that contains the formula.
An absolute cell reference takes the form $A$1, $B$1, etc.
91
Ms-Excel 2003
92
Ms-Excel 2003
2. #N/A
The #NA error value occurs when a value is not available to a function or formula.
Possible cause Suggested action
(i). Omitting 1 or more arguments in a function Enter all arguments in the function.
(ii). Using a custom worksheet function that is Make sure the function is working
not available properly
3. #DIV/0!
This error value occurs when you enter a formula that contains a division by zero (0).
E.g., =5/0. It may also occur when you divide a cell by another cell that is blank.
Suggested action.
(i). Change the divisor to a number other than zero.
4. #NULL!
The #NULL! error value occurs when you specify an intersection of two areas that do not
intersect. i.e., using an incorrect range operator or using an incorrect cell reference.
Suggested action.
(i). Use the correct range operator. For instance, to refer to two areas that don’t intersect,
use the Comma.
E.g. if the formula sums two ranges, separate the two ranges with a comma.
=SUM(A1:A9,C1:C6).
(ii). Check for typing errors in the reference to the ranges.
5. #NAME?
The #NAME? error value occurs when Ms-Excel doesn’t recognize text in a formula.
93
Ms-Excel 2003
Possible cause Suggested action
(i). Deleting a name used in the formula, or Make sure the name exists.
using a name that does not exist
(ii). Misspelling the name of a function Correct the spelling.
(iii). Omitting a colon (:) in a range reference Make sure all range references in the
formula use a colon.
E.g. =SUM(A1:A5)
(iv). Entering text in a formula without Enclose text in the formula in double
enclosing the text in double quotation marks (“). quotation marks.
Ms-Excel tries to interpret your entry as a name E.g. the following formula joins a
even though you intended it to be used as text. piece of text “The total amount is”
with the value in cell B5:
=”The total amount is” & B5
6. #NUM!
This occurs when a problem occurs with a number in a formula or function. E.g., Entering a
formula that produces a number to a number that is too large or too small to be represented in
Ms-Excel.
Suggested action
(i). Change the formula so that its result is between – 1*10307 and 1*10307.
7. #VALUE!
The #VALUE error value occurs when the wrong type of argument or operand is used.
8. #REF!
The #REF error value occurs when a cell reference is not valid. For instance, deleting cells
referred to by other formulas, or pasting moved cells over cells referred to by other formulas.
Suggested action
(i). Change the formulas, or restore the cells on the worksheet by clicking Undo
immediately after you delete or paste the cells.
Exercise.
1. You have entered a formula to add the contents of B5 and C4 in cell F5. What will it become
when you copy it to cell H8?
______________________________________________
Explain the reason for your answer.
2. What causes the following error messages in Microsoft Excel. Show how we can solve them.
(i). #####
(ii). #VALUE!
(iii). #DIV/0!
(iv). #NAME?
3. The first column in the table below contains formulas as entered into the cell D46. In the
second column, enter the formulas as they would appear when copied to B56.
Formula in D46 Formula when copied to B56
=D1
=F5*C10
=H$46+J40
=$E12-D$14*$F$2
DATA SORTING.
94
Ms-Excel 2003
Sorting is the process of arranging data within a range in a particular order.
Purpose.
√ Sorting helps in arranging data in some order of priority, i.e., from lowest to highest or from
highest to lowest.
√ It also helps to quickly locate the highest or lowest value in a list.
When you sort, Ms-Excel rearranges rows, columns, or individual cells by using the sort order
that you specify. You can sort a list in Ascending (1-9, A-Z) or Descending order (9-1, Z-A).
You can perform a sort based on the contents of one or more columns.
Note. The data is sorted in reference to columns.
To sort rows in ascending or descending order based on the contents of one column.
1. Click a cell in the column by which you want to sort. The column on which the list is
arranged is known as the Key.
2. To arrange the data from lowest to highest, click on the Sort Ascending button on the
toolbar. To arrange the data from highest to lowest, click on the Sort Descending button on
the toolbar.
-Or-
On the Data menu, click Sort. In the Sort by box, click the column you want to sort and
then choose the sort order.
To sort rows based on the contents of two or more columns.
1. Click a cell in the list you want to sort.
2. On the Data menu, click Sort to display the Sort dialog box.
3. Under Sort By, specify the first column by which you want to sort, then choose the sort order
by clicking on the Ascending or Descending box.
4. You can add up to two keys in the Then By boxes according to your need.
Assume that you need to sort by more than 3 columns, i.e., your list contains employee
information and you need to organize it by Department, Title, Last Name, and First Name,
sort the list twice. Click First Name in the first Sort by box and then sort the list. Click
Department in the second Sort by box, click Title in the first Then by box, and click Last
Name in the second Then by box, and then sort the list.
5. Select any other sort options you want, then click OK to perform the sort.
Sort columns based on the contents of rows.
1. Click a cell in the list you want to sort.
2. On the Data menu, click Sort.
3. Click the Options button.
4. Under Orientation, click Sort left to right, then click OK.
5. In the Sort by and Then by, click the rows you want to sort.
Examples:
(i). A teacher may arrange pupil’s records according to the marks scored in a test, starting with
the highest to the lowest in order to assign class positions.
(ii). An Accountant may arrange a list of financial records according to the date of the
transaction and customer name in order for him to be able to quickly locate any record
using the transaction date and name of customer.
(iii). Arranging a telephone list according to alphabetical order of last name in order to easily
locate a name and phone number. If there are several people with similar last names, you
can specify two keys such that the records are arranged in order of first name as well.
95
Ms-Excel 2003
LINKING WORKSHEETS.
Purpose.
√ Sheets are normally independent. If a change in a value in one sheet is intended to affect
other values in different sheets, it is advisable to link the sheets so that Ms-Excel will
automatically update the affected values if you make any changes.
Alternatively, you can calculate the new values and manually make the changes to all the
other sheets. This would be unreliable & cumbersome especially if this is to be done for
many values in many large worksheets.
1. When typing in a formula that refers to a cell in another sheet, include the name of the sheet
before that particular cell reference separated by a colon.
Example 1:
The formula =G6*Sheet1!B6 (instead of =G6*B6) will refer to B6 in Sheet 1 rather than in the
current sheet.
Example 2:
Typing the formula =Salesinfo!A10 in cell A10 of Sheet2 will cause the contents of cell A10 in
the Sheet named Salesinfo to be also the contents of A10 in Sheet2.
Exercise.
1. How would you display the contents of the cell B45 of worksheet named Price in the cell B5
of worksheet named Sales such that the two cells always display the same value?
CREATING CHARTS.
Purpose.
√ Charts are used to present data effectively. They make relationships among numbers easy for
users to see because they turn numbers into shapes that can be compared to one another.
For instance, rather than having to analyze several columns on worksheet numbers, you can
see at a glance whether sales are falling or rising over quarterly periods, or how the actual
sales compare to the projected sales.
Different Types of Charts and their uses.
(i). Line Chart: A Line graph is used to show trends.
(ii). Bar Chart: - It can be used to show comparison of Sales and Target.
(iii). A Stacked Bar Chart: - It can be used to show the distribution of sales by month and
compare the performance of salesmen.
(iv). A Pie Chart: shows the distribution of sales.
(v). Scatter Charts.
(vi). Column Charts.
Steps required when creating a simple chart.
1. Enter the data you want to be represented in the chart on the worksheet.
2. Select the cells or range that contains the data you want to be represented in chart.
If the cells you want to select for your chart are not in a continuous range,
Select the first group of cells that contain the data you want to include.
Hold down the CTRL, then select any additional cell groups you want to include. The
nonadjacent selections must form a rectangle.
3. On the Insert menu, click Chart (or click the Chart Wizard button on the Standard
toolbar). Then use the Chart Wizard to help you through the process of choosing the chart
type and the various chart options.
96
Ms-Excel 2003
4. Select Chart type.
In the Chart type dialog box, click the Standard Types tab or the Custom Types tab.
Under Chart Type, click the chart category you want to use, then select the type of chart
under Chart subtypes on the right.
A brief description of the chart selected appears below the sub-types. This helps you
decide whether the type suits the data you have selected. You may also view a sample of
the chart that will be produced.
Click on the Next button.
5. Specify the range of cells to include in the chart.
This gives you a chance to select your range again if necessary.
In the Chart Source data dialog box,
Click the Data range tab, then confirm the selected range or enter a new range.
Under Series in, click an option to change the way in which the data should be plotted;
across Rows or down Columns. To help you decide the right option, the sample chart
changes according to the selection you have made.
If you are sure about the range you have selected and the sample chart is what is desired,
click on the Next button.
6. Select the Chart options.
In this step, there are several chart options as indicated by the various categories at the top of
the Chart Options dialog box.
Click the Titles tab. Click in the Chart Title area and type in the title for your chart.
Type in the titles for axes in their respective places.
Click the Legend tab, and then select the Show Legend box. Under Placement, click an
option to show where the legend will be placed.
Click on the Next button.
Legend - A box that identifies the patterns or colors that are assigned to the data series or
categories in a chart. A legend indicates which color (pattern) represents what data item.
Axis - A line that borders one side of the plot area, providing a frame of reference for
measurement or comparison in a chart.
For most charts, data values are plotted along the value axis, which is usually vertical (Y-
axis), and categories are plotted along the category axis, which is usually horizontal (X-axis).
Note. Ms-Excel creates the axis values from the worksheet data.
7. Select the Location of Chart placement.
This step involves placing the chart you have created.
You can create a chart as an embedded object on the sheet you are working on or on its own
sheet.
Under Place chart, click an option either to insert the chart as a new sheet or as an
object in the current data sheet.
8. Click on the Finish button.
To change the Chart type.
1. Click the chart to activate the Chart menu.
2. On the Chart menu, click Chart Type.
3. Click the Standard Types tab, click the inbuilt chart type you want to use, then click the OK
button
Changing Chart Options.
1. Click the chart. On the Chart menu, click Chart Options to display the Chart Options
dialog box.
97
Ms-Excel 2003
99
Ms-Excel 2003
2. The chart has ‘Thousands’ displayed along the Y-axis, yet the figures are in Millions of
Kenya Shillings. How do you change the chart such that it displays ‘Millions of Kenya
Shillings’ instead?
3. You want the legends to become the X-axis titles and the X-axis titles to be used as the
legends. How do you implement this?
PRINTING A WORKSHEET.
Purpose.
√ Whenever you need a paper copy of the worksheet to present to other people.
√ If you maintain a paper filing system alongside the computer filing system.
PAGE SETUP.
You can control the appearance or layout of printed worksheets by changing options in the Page
Setup dialog box.
Purpose.
√ To define where one page ends and another page starts.
√ To print a large worksheet to fit on a single page.
√ To add descriptive information to be printed with your worksheet.
√ To define rows and columns you want to print on each page of the output.
√ To change the order in which various worksheets should print.
Setting the Page Margins.
1. Select the worksheet you want to print.
2. On the File menu, click Page Setup, then click the Margins tab.
3. In the Top, Bottom, Left, and Right boxes, enter the margin size you want.
You can also tell Ms-Excel to automatically position your worksheet at the center of the
page, both horizontally (across) and vertically (downwards) by clicking the options under
Center on Page.
To set Header or Footer margins.
To change the distance from the top edge to the header, enter a new margin size in the
Header box.
To change the distance from the bottom edge to the footer, enter a new margin size in the
Footer box.
These settings should be smaller than your top and bottom margin settings.
Tip. To see how the margins will affect the printed document, click Print Preview before the
document is printed.
Setting the paper Orientation.
Orientation specifies how the worksheet will be printed on a page.
1. On the Page Setup dialog box, click the Page tab.
2. Under Orientation, click Portrait or Landscape.
To set the Paper size for printing.
1. Click the Page tab.
2. In the Paper size box, select the size of paper you want to use from the resulting drop down
list.
3. If you want Ms-Excel to fit your worksheet on one page; under Scaling, click on Fit to and
make sure that the specification is “Fit to: 1 page(s) wide by 1 tall”.
100
Ms-Excel 2003
Setting the print Quality.
You can speed up the time it takes to print a worksheet by temporarily changing the printing
quality.
1. Click in the worksheet.
2. On the File menu, click Page Setup, then click the Page tab.
3. In the Print quality box, click the resolution you want to use.
To print in Draft quality,
Click Draft in the Print quality box.
Note. Draft quality increases printing speed by ignoring formatting and most graphics.
To add header and/or footer comments to be printed with your worksheet.
1. On the Page Setup dialog box, click the Header/Footer tab.
2. Under Header, type in the information you want to appear at the top of each page.
Under Footer, type in the information you want to appear at the bottom of each page.
Alternatively, you can click on the arrow on the right of the Header or Footer to reveal a list
of preset headers and footers and then select one of them.
102