MS Excel Notes
MS Excel Notes
Creating a Workbook
You start Excel by using any of the methods that you use to start other Microsoft
Windows programs. One common method is clicking the Start button, pointing to All
Programs, and choosing Microsoft Office then Microsoft office Excel on the
submenu. You can also click a shortcut icon, if one exists, on the desktop or on the
Quick Launch bar.
When you start Excel, a blank workbook, titled Book1, opens by default. A
workbook is a file that can contain multiple worksheets. In turn, a worksheet is a
grid of rows and columns in which you can enter data. For example, you might
create four budget worksheets in a single workbook, with each worksheet
containing a budget for one quarter of the upcoming fiscal year. If you’re a teacher
using Excel, you might create grading worksheets in the same workbook, with each
worksheet storing grade records for a semester of the same class. As you can see, a
workbook allows you to assemble worksheets that contain related data. After you
create a workbook, you can save it as a single file on your hard disk.
On the Windows taskbar, click the Start button, point to All Programs, Microsoft
Office and click Microsoft office Excel e.g. 2007. Excel opens with Book1 ready
for you to use. Title bar
1
Tool
bar Formula bar Ask a question box
Menu bar
Workbook
window
The following table describes the elements in the Excel window. Status bar
Element Description
Title bar Identifies the current program and the name of the current workbook.
Menu bar Lists the names of the menus in Excel.
Toolbars Give you quick access to functions that you use frequently, such as
formatting, aligning, and totaling cell entries. The Standard and
Formatting toolbars appear by default.
Name Box Displays the address of the active cell.
Formula Bar Displays the contents of the active cell.
Task pane Lets you open files, paste data from the Clipboard, create blank
workbooks, and create Excel workbooks based on existing files.
Ask A Displays the help topics that match your request, when you type a
Question box question in the box.
Status bar Displays information about a selected command. It also indicates the
status (on or off) of the Caps Lock and Num Lock keys.
Scroll bars Include a vertical and a horizontal scroll bar and four scroll arrows,
each of which is used to display different areas of the worksheet.
2
Select All Selects every cell in a worksheet.
button
Sheet tabs Let you display worksheets in the open workbook.
Worksheet A grid of vertical columns (identified by alphabetic characters) and
horizontal rows (identified by numeric digits). Columns and rows
intersect to form cells. Each cell can be identified by a full-cell
reference, or address, consisting of the column and row coordinates
of that cell—for example, B3.
Active cell The cell, designated by a thick border, which will be affected when you
type or edit data.
Minimize Minimizes the window to a button on the taskbar.
button
Maximize/ Toggles (switches back and forth) between maximizing a window and
Restore Down restoring a window to its previous size.
button
Close button Closes the window on which the button appears.
3
In this exercise, you will work with Excel window elements.
1 clicks Insert button on the menu bar to view different Charts Wizard.
A ScreenTip appears, displaying the different Chart Wizards.
2 Point to the Name Box, which contains the cell address A1.
A ScreenTip appears, displaying the title Name Box.
3 Click Home button on the menu bar to access different Tools at the
Formatting toolbar.
A menu with tool options appears.
4 Position your mouse pointer over each newly displayed tool button.
A ScreenTip appears to explain each button.
Selecting Cells
Before you can enter data into a worksheet, you must identify the cell (the
intersection of a row and a column) in which you want to put the data. This is known
as selecting the cell. You can select a single cell, a row, a column, and groups of
adjacent and nonadjacent cells.
To select a single cell, simply click that cell. When a cell is selected, a black border
surrounds it, and that cell becomes the active cell.
You can select all of the cells in a worksheet by clicking the Select All button at the
top-left corner of the worksheet.
Select all
button
4
You can select a single row or column in a worksheet by clicking the corresponding
row or column selector.
You select a range of cells by dragging the mouse pointer over the cells. When you
select a range of cells, the first cell chosen becomes the active cell. The active cell is
white, and the range of cells is blue.
In this exercise, you select a group of adjacent cells in the current worksheet.
1 Click cell E3, hold down the mouse button, drag the mouse pointer down to
cell E12, and release the mouse button.
The range E3:E12 is selected, and E3 remains the active cell.
5
empty), or it appears in truncated form (if the adjacent cell is not empty). Internally,
however, the text is stored in only one cell and includes each character originally
entered.
In this exercise, you view two worksheets within the same workbook.
1 Click the Sheet2 tab at the bottom of the workbook window.
Sheet2 and its contents appear. The worksheet is blank.
6
2 Click the Sheet1 tab at the bottom of the workbook window.
Sheet1 and its contents reappear.
7
Previewing and Printing a Worksheet
After a worksheet is complete, you can preview and print its contents. To print a
worksheet, you begin by displaying the Print dialog box. In this dialog box, you can
change most print settings, preview the data, and print the worksheet.
The distinguishing feature of a spreadsheet program such as Excel is that it allows
you to create mathematical formulas and execute functions. Otherwise, it is not
much more than a large table for displaying text. This page will show you how to
create these calculations.
Operators in Excel
Functions in Excel
Functions shorten formulae. For example, to add the values in the cellsC1 to C10,
the formula is =(C1+C2+C3+C4+C5+C6+C7+C8+C9+C10). If a function is used, we
need to type only =SUM (C1:C10)
Complex formulae can be created using functions and some tasks can be
accomplished only by using functions
For example, to display the current date and time use TODAY () and NOW ()
functions.
Mathematical and Statistical Functions
(a) SUM ()
It is a mathematical function used to add the numeric value in a range of cells. A
maximum of 30 arguments can be provided
It has the syntax below:
=SUM(range)
Example Description
=SUM(C5:C10) Total of numbers in the range C5 to C10
=SUM(C5,C7,C10,D5) Total of numbers in the cells C5,C7,C10
and D5
9
(b) AVERAGE ()
It is a statistical function used to calculate and return the average (arithmetic mean)
of numeric values in the range of cells. It has the syntax below:
=AVERAGE(range)
Example Description
=AVERAGE(C5:C10) Average of numbers in the range C5 to C10
=AVERAGE(C5,C7,C10,D5) Average of numbers in the cells C5,C7,C10
and D5
(c) PRODUCT ()
Multiplies values in a range of cells and returns the result in a specified cell.
Its syntax is given below;
=PRODUCT(range)
(d) MODE()
it is a statistical function that returns the most frequently occurring value in a set of
values
its syntax is;
=MODE(range)
(e) MAX()
It is a statistical function that returns the largest value in the range.
It has the syntax below:
=MAX(range)
Example Description
=MAX(C5:C10) Highest value in the range C5 to C10
=MAX(10,5,18,7) Highest value 18
(f) MIN ()
It is a statistical function that returns the lowest value in the range
It has the syntax below:
=MIN(range)
(g) COUNT()
It is a statistical function that counts the number of cells that contain numbers in the
specified range
It has the syntax
=COUNT(range)
10
TEXT FUNCTIONS
E.g. suppose the cell B1 contains a text DESIGNATION
(a) LEN() Returns the length of a text string. Spaces are counted as characters
Syntax:
=LEN(string)
EXAMPLE RESULT
=LEN(B1) 11
=LEN(“NAME”) 4
(b) LEFT()
Returns the specified number of characters form the left side of a text string. If the
number is not specified, it returns the first character. Its syntax is given below:
=LEFT(String, number)
EXAMPLE RESULT
=LEFT(B1,5) DESIG
=LEFT(B1) D
=LEFT(“NAME”,3) NAM
(c) RIGHT()
It is the opposite of the former. Its syntax is given below:
=RIGHT(String, number)
(e) UPPER()
Coverts all lower case letters in a text string to upper case. Its syntax is given below:
=UPPER(String)
EXAMPLE RESULT
=UPPER(B1) DESIGNATION
=UPPER(“clean me”) CLEAN ME
(f) LOWER().
It’s the opposite of the former. Its syntax is given below:
=LOWER(String)
Logical Functions
The functions are used to see whether a condition is true or false or to check for
multiple conditions.
1. IF()
11
The function IF is used 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.
Its syntax is given below:
IF(condition, true action, false action)
Formulas
Formulas are entered in the worksheet cell and must begin with an equal sign "=".
The formula then includes the addresses of the cells whose values will be
manipulated with appropriate operands placed in between. After the formula is
typed into the cell, the calculation executes immediately and the formula itself is
visible in the formula bar. See the example below to view the formula for calculating
the sub total for a number of textbooks. The formula multiplies the quantity and
price of each textbook and adds the subtotal for each book. The interface below is
for MS Office 2003
Linking Worksheets
You may want to use the value from a cell in another worksheet within the same
workbook in a formula. For example, the value of cell A1 in the current worksheet
and cell A2 in the second worksheet can be added using the format "sheetname!
celladdress". The formula for this example would be "=A1+Sheet2!A2" where the
value of cell A1 in the current worksheet is added to the value of cell A2 in the
worksheet named "Sheet2".
13
description and example of use is provided below the two boxes-excel 2003
Click OK when all the cells for the function have been selected.
Autosum
Use the Autosum function to add the contents of a cluster of adjacent cells.
Select the cell that the sum will appear in that is outside the cluster of cells
whose values will be added. Cell C2 was used in this example.
Click the Autosum button (Greek letter sigma) on the standard toolbar.
Highlight the group of cells that will be summed (cells A2 through B2 in this
example).
Press the ENTER key on the keyboard or click the green check mark button on
the formula bar .
14
Basic Sorts
To execute a basic descending or ascending sort based on one column, highlight the
cells that will be sorted and click the Sort Ascending (A-Z) button or Sort Descending
(Z-A) button on the standard toolbar.
Complex Sorts
To sort by multiple columns in excel 2003, follow these steps:
Highlight the cells, rows, or columns that will be sorted.
Select Data|Sort from the menu bar.
From the Sort dialog box, select the first column for sorting from the Sort By
drop-down menu and choose either ascending or descending.
Select the second column and, if necessary, the third sort column from the
Then By drop-down menus.
If the cells you highlighted included the text headings in the first row, mark
My list has...Header row and the first row will remain at the top of the
worksheet.
Click the Options button for special non-alphabetic or numeric sorts such as
months of the year and days of the week.
Charts allow you to present data entered into the worksheet in a visual format using
a variety of graph types. Before you can make a chart you must first enter data into
a worksheet. This page explains how you can create simple charts from the data.
Chart Wizard
The Chart Wizard brings you through the process of creating a chart by displaying a
series of dialog boxes.
16
Enter the data into the worksheet and highlight all the cells that will be
included in the chart including headers.
Click the insert button on the menu bar and select the Chart type of your
choice i.e. column graph, pie chart, line graph, bar graph etc.
Chart Location – right click and move chart to a location
17
Practical questions
19
(A) Generate the basic pay using the IF statement assuming that it’s paid
according to title as shown below.
Title Basic Pay
ACP 700,000
SP 444,000
SSP 300,000
ASP 639,000
(B) Generate the allowances using the IF statement assuming it’s paid according
to the marital status as shown below:
Marital Status Allowance
Married 850,000
Divorced 980,000
Single 350,000
© Sort by title and add sub totals for basic pay for each title.
(d) Auto format the table using the auto format style called list1.
QUESTION 4
A B C D E
1 NAME SEX BANK DEPT. SALARY
2 SARAH F UCB FN. 300000
3 TOM M NILE ACCTS 200000
4 TIM M BOU ADM 600000
5 BEN M UDB FN. 500000
Write down formulas to compute the following
i. Total amount of salary earned by the employees
ii. Minimum salary
iii. Maximum salary
iv. Count of salary
v. Average salary
QUESTION 5
A B C D E F H I
1 NAME BASIC HOUSING TRANSPORT MEDICAL GROSS NSSF NET
2 JOHN 100000 30000 10000 20000
20
3 SARAH 120000 40000 20000 22000
4 ANYAU 200000 60000 30000 25000
Questions:
Write down formulas to:
a. Calculate the GROSS pay for employee
b. Charge 5% of gross pay to get NSSF.
c. Calculate the PAYE (Pay as You Earn), which is charged at 10% of Gross
pay.
d. Calculate the Net pay for employee
Question6
a. The table below shows students/pupil selection to Senior One.
A B C D E F G
1 PUPID ENG MATHS GP AGGREGATE AVERAGE REMARKS
2 P001 4 2 1
3 P002 6 9 2
4 P003 1 3 2
5 P004 6 9 4
(i) Write a formula you would enter in E2 to compute the total aggregate mark.
(ii) Write a formula you would enter in F2 to compute the average mark.
(iii) Write a formula you would enter in G 2 to comment on whether a pupil is in first
grade or other grade
Note: If total aggregate mark is less than 8 a pupil was in “First Grade” otherwise
“Other grade”.
(iv) Write formulas in H2 and I2 to compute the poorly and best done subjects
respectively.
Excel Sort
Sorting in Excel lets you easily reorder your data based on the type of sorting that
you choose. This lesson will show you how to do a normal and reverse alphabetical
sort, as well as descending numerical ordering.
21
Raw Unordered Data
Imagine that you were teaching an English class and just collected the homework
assignment for that day. The papers are in no special order, but you know that Excel
can sort it all out for you anyways. You plough through the jumble of papers and
enter the data into Excel, ending up with something that looks like...
With the data entered you are now ready to begin sorting in Excel.
Excel Sorting: Alphabetical Order (Ascending)
The most common type of sorting, and one that is applicable to our situation, is
alphabetical ordering. This kind of ordering places the cells that start with the early
letters of the alphabet (a, b, c...) at the top and the later letters (t, u, v...) at the
bottom of the list.
1. First we need to select all the data so we can begin to sort it. Because each
name has a corresponding score we need to select both columns to preserve
the students' correct scores.
2. Left-click and hold on cell A1 then drag down-right to cell B10 to highlight all
the data for sorting! Your spreadsheet should look like this:
3. Left-click the "sort ascending" button, located near the top, on the shortcut
bar (it has a blue A on top and a red Z on bottom with a downward pointing
arrow).
22
4. Your spreadsheet should now be sorted.
Notice that your column titles (Name and Score) have not been included for sorting
because Excel is smart enough to know that you do not want these special cells (A1
and B1) included.
Reverse Alphabetical Order (Descending)
The steps for reverse alphabetical order are the same as above, except that you
need to click the "sort descending" button instead.
1. Select the data you wish to sort (left-click in cell A1 and drag down-right to
B10)
2. Left-click the "sort descending" button, located near the top, on the shortcut
bar (it has a red Z on top and a blue A on bottom downward pointing arrow).
3. Your spreadsheet should now be sorted in reverse alphabetical order.
Numerical Ordering
If you wanted to instead sort the homework assignments by highest to lowest score
you would follow these steps to use Excel's numeric sorting. The only difference
between this example and our previous examples is which column you start your
selection from, so pay close attention to the first step!
23
1. Left-click cell B1 and drag down-left to cell A10
2. Left-click the "sort descending" button, located near the top, on the shortcut
bar (it has a red Z on top and a blue A on bottom with a downward pointing
arrow).
3. Your Excel data should now look like:
Congratulations, you now know how to sort columns of both numbers and words in
Excel!
Note: Be sure that you select your data before going to the manual sorting feature.
This will let Excel know which data you want to sort.
8. Press OK
Because our sales were only $30,000 the if statement should be printing out "We
are losing money?"
Else
25
Notice that when the value of A2 was $30,000 it was less than $40,000 and our IF
function was set to print out "We are losing money?" when A2 was less than
40,0000. However, when we changed the value of A2 to $50,000 the IF statement
was now false and it printed out "We are making money!"
IF Function Syntax
The syntax of the IF function is =IF(logical test, value if true, value if false). The
logical test is any value or expression that Excel evaluates as true or false. Some
examples of expressions are B4>C4, B7<100, and
B8<=999.
Suppose you want to display a warning message if the nutrient content of Vitamin A
in cell B4 is less than 50% and display the message “Value is at least 50%” if not low.
You could use the formula: =IF(B4<50%, “Value is less than 50%!”,”Value is at least
50%”).
3. If the text in cell D4 is correct, replicate this formula from cell D4 through cell
D20.
26
4. Next, enter a formula using the IF function that prints “Low” if any
PowerPunch nutrient falls below 75%, but if the value is at least 75%, it prints
a blank. To print a blank, just put a space in between the quotation marks.
5. Save your work.
Nested IF Statements
Remember that the IF function returns one value if a condition is TRUE and another
value if it is FALSE. From the previous exercise, you entered an IF function using the
syntax =IF(logical_test,value_if_true,value_if_false). A logical test is any value or
expression that can be evaluated to TRUE or FALSE. For example, A10=100 is a
logical expression; if the value in cell A10 is equal to 100, the expression evaluates as
TRUE. Otherwise, the expression evaluates as FALSE. This argument can use any
comparison calculation operator:
Comparison operator
Meaning (Example)
2. In cell B2, enter the following formula using nested IF statements to assign a
letter grade to the first score. =IF(A2>89,"A",IF(A2>79,"B",
IF(A2>69,"C",IF(A2>59,"D","F"))))
3. Autofill the formulas by dragging down from the right bottom corner of the
cell when the cursor changes to a black cross to complete the column as
shown and save your work.
28
In the preceding example, the second IF statement is also the value_if_false
argument to the first IF statement. Similarly, the third IF statement is the
value_if_false argument to the second IF statement. For example, if the first
logical_test (Average>89) is TRUE, "A" is returned. If the first logical_test is FALSE,
the second IF statement is evaluated, and so on.
The letter grades are assigned to numbers using the following key.
Valid returns When a nested function is used as an argument, it must return the
same type of value that the argument uses. For example, if the argument returns a
TRUE or FALSE value, then the nested function must return a TRUE or FALSE. If it
doesn't, Microsoft Excel displays a #VALUE! error value.
Nesting level limits A formula can contain up to seven levels of nested functions.
When Function B is used as an argument in Function A, Function B is a second-level
function. For instance, the AVERAGE function and the SUM function are both
second-level functions because they are arguments of the IF function. A function
nested within the AVERAGE function would be a third-level function, and so on.
Example 1
29
If(mark>50,”PASS”,”FAIL”), will display a PASS if values are more than 50else it will
display FAIL
Example 2
Consider the spreadsheet below
A B C D E F
1 Name Designation Salary Age Tax Net pay
2 Abigail Officer 2500 26
3 Issac Manager 3750 24
4 Ruth Trainer 1550 29
5 Jackson Officer 2200 30
I taught you how to do simple IF statements based on one condition and one value if true or false.
This shows you how to do this with multiple conditions and multiple true/false values.
For this, let’s use some new data. Open a blank workbook in Excel and enter this data:
A B C D E
31
6 Mark South $ 2,050.00 6
Let’s pretend this is data which shows your salespeople’s district, annual sales, and number of years
employed by your company. Now, let’s suppose you want a formula in column E that will assign a job
level based on two different criteria: Salespeople who have been employed for more than 5 years
AND have annual sales of more than $10,000 should be assigned a job level code of 2, and all others
should have a job level code of 1. To include two criteria, when both criteria must be met, you must
nest an AND function within your IF statement. Put this formula in cell E2:
=IF((AND(D2>5,C2>10000)),2,1)
Then, grab cell E2 by its fill handle and drag it down to cell E8 to “relatively” copy it to the rest of the
cells in column E.
You see this formula uses a nested AND function for its “logical test”. The AND function will decide if
both conditions are true. Remember, the IF function’s second and third arguments return a “value if
true” and a “value if false”, so if the AND function returns a “true”, a 2 will be placed in the cell and if
the AND function returns a “false”, a 1 will be placed in the cell. Excel will look into the deepest
nested function first, then work it’s way out, so the first thing it does is determine the result of the
AND function, then it goes out to the IF function and performs that, based on the results of the AND
function.
This formula, if entered correctly, should show job level code 2 for Joe and Mary only, because they
are the only two who have worked for the company more than five years AND had annual sales
greater than $10,000.
Similarly, you can use a nested OR function if you want a job level code of 2 to be applied if an
employee meets EITHER criterion, instead of both criteria. A nested OR function works the same way
as an AND function, except it will return the 2, if ANY of the criteria are met, instead of requiring that
ALL criteria are met.
32
=IF((OR(D2>5,C2>10000)),2,1)
In this case, everyone is assigned a job level 2 except John, because he is the only one who did not
meet either criterion, since he has not worked for the company for more than 5 years OR had annual
sales greater than $10,000.
You can use more than two criteria in nested ANDs and ORs. Simply separate them by commas.
These examples work great when there are only two job levels, but what if there are more than two?
In this case, you will have more than two criteria and more than one value if true and value if false.
Let’s say we want to assign a job level 3 if the employee meets BOTH criteria above, a job level 2 if
the employee meets EITHER criteria above, and a job level 1 if the employee doesn’t meet any of the
criteria above.
=IF((AND(D2>5,C2>10000)),3,(IF((OR(D2>5,C2>10000)),2,1)))
Notice what we are doing here is basically nesting one IF statement within another. However, though
we have two different logical tests and two different values if true, we only have one value if false.
You can nest up to 7 IFs in one formula, so that means you can return up to 8 different results (7
different values if true and one value if false).
You can also nest multiple IFs if you want different results based on different values in the same cell.
For this example, let’s say all of the employees in the East district will be assigned a job level 4, the
West ones will be job level 3, the North ones will be job level 2, and the ones in the South will be job
level 1. Our formula would look like this:
=IF((B2="East"),4,IF((B2="West"),3,IF((B2="North"),2,IF((B2="South"),1,""))))
Note that the value if false is “”, which tells Excel to leave the cell empty if no match is found in
column B for that row. If you delete the contents of any cell in column B or change it to anything
other than East, West, North, or South, you will see the corresponding cell in column E would now be
empty. Remember, you must have something in your third argument (value if false) or Excel will
simply enter the text “FALSE” into that cell if it does not find a match.
I think I’ve given you enough information now, so you can build pretty extravagant IF statements. Just
remember that limit of seven nested IFs though, because there is no way to increase this using an IF
33
statement. However, when you really need more than eight conditions, there are other functions
that will serve you better than Nested IFs. One set of functions are the LOOKUP functions.
34