Lab Manual 7
Lab Manual 7
ComputerEngineering
Faculty of Engineering & Applied Sciences
Riphah International University, Islamabad, Pakistan
Experiment 7: Excel Wizardry: Formulas, Functions, and AI Tools for Data Manipulation
Name: ……………………………………. Roll No: …………………………
Word
The Microsoft Excel Window
Microsoft Excel is an electronic spreadsheet. You can use it to organize your data into rows and
columns. You can also use it to perform mathematical calculations quickly. This tutorial teaches
Microsoft Excel basics. Although knowledge of how to navigate in a Windows environment is
helpful, this tutorial was created for the computer novice.
This lesson will introduce you to the Excel window. You use the window to interact with Excel. To
begin this lesson, start Microsoft Excel 2007. The Microsoft Excel window appears and your
screen looks similar to the one shown here.
Note: Your screen will probably not look exactly like the screen shown. In Excel 2007, how a
window displays depends on the size of your window, the size of your monitor, and the
resolution to which your monitor is set. Resolution determines how much information your
computer monitor can display. If you use a low resolution, less information fits on your screen,
but the size of your text and images are larger. If you use a high resolution, more information
fits on your screen, but the size of the text and images are smaller. Also, settings in Excel
2007, Windows Vista, and Windows XP allow you to change the color and style of your
windows.
The Microsoft Office Button
In the upper-left corner of the Excel 2007 window is the Microsoft Office button. When you
click the button, a menu appears. You can use the menu to create a new file, open an existing file,
save a file, and perform many other tasks.
Next to the Microsoft Office button is the Quick Access toolbar. The Quick Access toolbar
gives you with access to commands you frequently use. By default, Save, Undo, and Redo
appear on the Quick Access toolbar. You can use Save to save your file, Undo to roll back an
action you have taken, and Redo to reapply an action you have rolled back. The Title Bar
Next to the Quick Access toolbar is the Title bar. On the Title bar, Microsoft Excel displays the
name of the workbook you are currently using. At the top of the Excel window, you should see
"Microsoft Excel - Book1" or a similar name. The Ribbon
You use commands to tell Microsoft Excel what to do. In Microsoft Excel 2007, you use
the Ribbon to issue commands. The Ribbon is located near the top of the Excel window,
below the Quick Access toolbar. At the top of the Ribbon are several tabs; clicking a tab
displays several related command groups. Within each group are related command buttons.
You click buttons to issue commands or to access menus and dialog boxes. You may also
find a dialog box launcher in the bottom-right corner of a group. When you click the dialog
box launcher, a dialog box makes additional commands available.
Worksheets
Microsoft Excel consists of worksheets. Each worksheet contains columns and rows. The
columns are lettered A to Z and then continuing with AA, AB, AC and so on; the rows are
numbered 1 to 1,048,576. The number of columns and rows you can have in a worksheet is
limited by your computer memory and your system resources.
The combination of a column coordinate and a row coordinate make up a cell address. For
example, the cell located in the upper-left corner of the worksheet is cell A1, meaning
column A, row 1. Cell E10 is located under column E on row 10. You enter your data into
the cells on the worksheet.
The Formula Bar
Formula Bar
If the Formula bar is turned on, the cell address of the cell you are in displays in the
Name box which is located on the left side of the Formula bar. Cell entries display on the
right side of the Formula bar. If you do not see the Formula bar in your window, perform the
following steps:
Note: The current cell address displays on the left side of the Formula bar. The
Status Bar
The Status bar appears at the very bottom of the Excel window and provides such
information as the sum, average, minimum, and maximum value of selected numbers. You
can change what displays on the Status bar by right-clicking on the Status bar and
selecting the options you want from the Customize Status Bar menu. You click a menu
item to select it. You click it again to deselect it. A check mark next to an item means the
item is selected. Move Around a Worksheet
By using the arrow keys, you can move around your worksheet. You can use the down
arrow key to move downward one cell at a time. You can use the up arrow key to move
upward one cell at a time. You can use the Tab key to move across the page to the right,
one cell at a time. You can hold down the Shift key and then press the Tab key to move to
the left, one cell at a time. You can use the right and left arrow keys to move right or left
one cell at a time. The Page Up and Page Down keys move up and down one page at a
time. If you hold down the Ctrl key and then press the Home key, you move to the
beginning of the worksheet.
• Press the down arrow key several times. Note that the cursor moves downward one
cell at a time.
The Up Arrow Key
• Press the up arrow key several times. Note that the cursor moves upward one cell at
a time.
Hold down the Shift key and then press Tab. Note that the cursor moves to the left one
cell at a time.
1. Press the right arrow key several times. Note that the cursor moves to the right.
2. Press the left arrow key several times. Note that the cursor moves to the left.
1. Press the Page Down key. Note that the cursor moves down one page.
2. Press the Page Up key. Note that the cursor moves up one page.
Go To Cells Quickly
The following are shortcuts for moving quickly from one cell in a worksheet to a cell in a
different part of the worksheet.
Go to -- F5
The F5 function key is the "Go To" key. If you press the F5 key, you are prompted for the
cell to which you wish to go. Enter the cell address, and the cursor jumps to that cell.
Go to -- Ctrl+G
1. Hold down the Ctrl key while you press "g" (Ctrl+g). The Go To dialog box
opens.
2. Type C4 in the Reference field.
3. Press Enter. Excel moves to cell C4.
You can also use the Name box to go to a specific cell. Just type the cell you want to go to in
the Name box and then press Enter.
If you wish to perform a function on a group of cells, you must first select those cells by
highlighting them. The exercises that follow teach you how to select.
You can also select an area by holding down the left mouse button and dragging the mouse
over the area. In addition, you can select noncontiguous areas of the worksheet by doing the
following:
1. Go to cell A1.
2. Hold down the Ctrl key. You won't release it until step 9. Holding down the
Ctrl key enables you to select noncontiguous areas of the worksheet.
3. Press the left mouse button.
4. While holding down the left mouse button, use the mouse to move from cell
A1 to C5.
5. Continue to hold down the Ctrl key, but release the left mouse button.
6. Using the mouse, place the cursor in cell D7.
7. Press the left mouse button.
8. While holding down the left mouse button, move to cell F10. Release the left
mouse button.
9. Release the Ctrl key. Cells A1 to C5 and cells D7 to F10 are selected.
10. Press Esc and click anywhere on the worksheet to remove the highlighting.
Enter Data
In this section, you will learn how to enter data into your worksheet. First, place the cursor in
the cell in which you want to start entering data. Type some data, and then press Enter. If you
need to delete, press the Backspace key to delete one character at a time.
Enter Data
Delete Data
Edit a Cell
After you enter data into a cell, you can edit the data by pressing F2 while you are in the cell
you wish to edit.
Edit a Cell
You can also edit the cell by using the Formula bar. You change "Jones" to "Joker" in the
following exercise.
Entry
Typing in a cell replaces the old cell entry with the new information you type.
Wrap Text
When you type text that is too long to fit in the cell, the text overlaps the next cell. If you do
not want it to overlap the next cell, you can wrap the text.
Wrap Text
1. Move to cell A2.
2. Type Text too long to fit.
3. Press Enter.
To delete an entry in a cell or a group of cells, you place the cursor in the cell or select the
group of cells and press Delete.
In Microsoft Excel, you can specify the direction the cursor moves when you press the Enter
key. In the exercises that follow, the cursor must move down one cell when you press Enter.
You can use the Direction box in the Excel Options pane to set the cursor to move up, down,
left, right, or not at all. Perform the steps that follow to set the cursor to move down when
you press the Enter key.
1. Click the Microsoft Office button. A menu appears.
2. Click Excel Options in the lower-right corner. The Excel Options pane appears.
3. Click Advanced.
4. If the check box next to After Pressing Enter Move Selection is not checked, click
the box to check it.
5. If Down does not appear in the Direction box, click the down arrow next to the
Direction box and then click Down.
6. Click OK. Excel sets the Enter direction to down.
In Microsoft Excel, you can enter numbers and mathematical formulas into cells. Whether
you enter a number or a formula, you can reference the cell when you perform
mathematical calculations such as addition, subtraction, multiplication, or division. When
entering a mathematical formula, precede the formula with an equal sign. Use the
following to indicate the type of calculation you wish to perform:
+ Addition
- Subtraction
* Multiplication
/ Division
^ Exponential
In the following exercises, you practice some of the methods you can use to move
around a worksheet and you learn how to perform mathematical calculations. Refer to
Lesson 1 to learn more about moving around a worksheet. Addition
Note: Clicking the check mark on the Formula bar is similar to pressing Enter. Excel records
your entry but does not move to the next cell.
Subtraction
4. Type Subtract.
5. Press Enter. Excel moves down one cell.
6. Type 6 in cell B2.
7. Press Enter. Excel moves down one cell.
8. Type 3 in cell B3.
9. Press Enter. Excel moves down one cell.
10. Type =B2-B3 in cell B4.
11. Click the check mark on the Formula bar. Excel subtracts cell B3 from cell B2
and the result displays in cell B4. The formula displays on the Formula bar.
Multiplication
1. Hold down the Ctrl key while you press "g" (Ctrl+g). The Go To dialog box
appears.
2. Type C1 in the Reference field.
3. Press Enter. Excel moves to cell C1
4. Type Multiply.
5. Press Enter. Excel moves down one cell.
6. Type 2 in cell C2.
7. Press Enter. Excel moves down one cell.
8. Type 3 in cell C3.
9. Press Enter. Excel moves down one cell.
10. Type =C2*C3 in cell C4.
11. Click the check mark on the Formula bar. Excel multiplies C1 by cell C2 and
displays the result in cell C3. The formula displays on the Formula bar.
Division
1. Press F5.
2. Type D1 in the Reference field.
3. Press Enter. Excel moves to cell D1.
4. Type Divide.
5. Press Enter. Excel moves down one cell.
6. Type 6 in cell D2.
7. Press Enter. Excel moves down one cell.
8. Type 3 in cell D3.
9. Press Enter. Excel moves down one cell.
10. Type =D2/D3 in cell D4.
11. Click the check mark on the Formula bar. Excel divides cell D2 by cell D3 and
displays the result in cell D4. The formula displays on the Formula bar.
When creating formulas, you can reference cells and include numbers. All of the following
formulas are valid:
=A2/B2
=A1+12-B3
=A2*B2+12
=24+53
AutoSum
You can use the AutoSum button on the Home tab to automatically add a column or row
of numbers. When you press the AutoSum button , Excel selects the numbers it thinks
you want to add. If you then click the check mark on the Formula bar or press the Enter key,
Excel adds the numbers. If Excel's guess as to which numbers you want to add is wrong, you
can select the cells you want.
AutoSum
1. Go to cell F1.
2. Type 3.
3. Press Enter. Excel moves down one cell.
4. Type 3.
5. Press Enter. Excel moves down one cell.
6. Type 3.
7. Press Enter. Excel moves down one cell to cell F4.
8. Choose the Home tab.
9. Click the AutoSum button in the Editing group. Excel selects cells F1 through
F3 and enters a formula in cell F4.
10. Press Enter. Excel adds cells F1 through F3 and displays the result in cell F4.
Perform Automatic Calculations
By default, Microsoft Excel recalculates the worksheet as you change cell entries. This
makes it easy for you to correct mistakes and analyze a variety of scenarios.
Automatic Calculation
Make the changes described below and note how Microsoft Excel automatically recalculates.
When you type text into a cell, by default your entry aligns with the left side of the cell.
When you type numbers into a cell, by default your entry aligns with the right side of the
cell. You can change the cell alignment. You can center, left-align, or right-align any cell
entry. Look at cells A1 to D1. Note that they are aligned with the left side of the cell.
Center
Right-Align
Note: You can also change the alignment of cells with numbers in them by using the
alignment buttons.
Advanced Calculations
To change the order of calculation, use parentheses. Microsoft Excel calculates the
information in parentheses first.
Note: Microsoft Excel adds 3 plus 3 plus 12, divides the answer by 2, and then multiplies the
result by 4. The answer, 36, displays in cell A7.
Copy, Cut, Paste, and Cell Addressing
In Excel, you can copy data from one area of a worksheet and place the data you copied
anywhere in the same or another worksheet. In other words, after you type information into a
worksheet, if you want to place the same information somewhere else, you do not have to
retype the information. You simple copy it and then paste it in the new location.
You can use Excel's Cut feature to remove information from a worksheet. Then you can use
the Paste feature to place the information you cut anywhere in the same or another
worksheet. In other words, you can move information from one place in a worksheet to
another place in the same or different worksheet by using the Cut and Paste features.
Microsoft Excel records cell addresses in formulas in three different ways, called absolute,
relative, and mixed. The way a formula is recorded is important when you copy it. With
relative cell addressing, when you copy a formula from one area of the worksheet to another,
Excel records the position of the cell relative to the cell that originally contained the formula.
With absolute cell addressing, when you copy a formula from one area of the worksheet to
another, Excel references the same cells, no matter where you copy the formula. You can use
mixed cell addressing to keep the row constant while the column changes, or vice versa. The
following exercises demonstrate.
In addition to typing a formula as you did in Lesson 1, you can also enter formulas by using
Point mode. When you are in Point mode, you can enter a formula either by clicking on a
cell or by using the arrow keys.
Compare the formula in cell A12 with the formula in cell B12 (while in the respective cell,
look at the Formula bar). The formulas are the same except that the formula in cell A12
suMicrosoft the entries in column A and the formula in cell B12 suMicrosoft the entries in
column B. The formula was copied in a relative fashion.
Before proceeding with the next part of the exercise, you must copy the information in cells
A7 to B9 to cells C7 to D9. This time you will copy by using the Mini toolbar. Copy with
the Mini Toolbar
1. Select cells A9 to B11. Move to cell A9. Press the Shift key. While holding down
the Shift key, press the down arrow key twice. Press the right arrow key once.
Excel highlights A9 to B11.
2. Right-click. A context menu and a Mini toolbar appear.
3. Click Copy, which is located on the context menu. Excel copies the information in
cells A9 to B11.
You make a cell address an absolute cell address by placing a dollar sign in front of the row
and column identifiers. You can do this automatically by using the F4 key. To illustrate:
The keyboard shortcut for Cut is Ctrl+x. The steps for cutting and pasting with a keyboard
shortcut are:
You can insert and delete columns and rows. When you delete a column, you delete
everything in the column from the top of the worksheet to the bottom of the worksheet.
When you delete a row, you delete the entire row from left to right. Inserting a column or
row inserts a completely new column or row.
To insert rows:
Create Borders
You can use borders to make entries in your Excel worksheet stand out. You can choose from
several types of borders. When you press the down arrow next to the Border button
, a menu appears. By making the proper selection from the menu, you can place a
border on the top, bottom, left, or right side of the selected cells; on all sides; or around the
outside border. You can have a thick outside border or a border with a single-line top and a
doubleline bottom. Accountants usually place a single underline above a final number and a
double underline below. The following illustrates:
Create Borders
Sometimes, particularly when you give a title to a section of your worksheet, you will
want to center a piece of text over several columns or rows. The following example shows
you how. Merge and Center
1. Go to cell B2.
2. Type Sample Worksheet.
3. Click the check mark on the Formula bar.
4. Select cells B2 to E2.
5. Choose the Home tab.
6. Click the Merge and Center button in the Alignment group. Excel merges
cells B2, C2, D2, and E2 and then centers the content.
To make a section of your worksheet stand out, you can add background color to a cell or
group of cells.
selected.
Change the Font, Font Size, and Font Color
A font is a set of characters represented in a single typeface. Each character within a font is
created by using the same basic style. Excel provides many different fonts from which you
can choose. The size of a font is measured in points. There are 72 points to an inch. The
number of points assigned to a font is based on the distance from the top to the bottom of its
longest character. You can change the Font, Font Size, and Font Color of the data you enter
into Excel.
Change the Font
In Microsoft Excel, each workbook is made up of several worksheets. Each worksheet has a
tab. By default, a workbook has three sheets and they are named sequentially, starting with
Sheet1. The name of the worksheet appears on the tab. Before moving to the next topic,
move to a new worksheet. The exercise that follows shows you how.
Move to a New Worksheet
Click Sheet2 in the lower-left corner of the screen. Excel moves to Sheet2.
Bold, Italicize, and Underline
When creating an Excel worksheet, you may want to emphasize the contents of cells by
bolding, italicizing, and/or underlining. You can easily bold, italicize, or underline text with
Microsoft Excel. You can also combine these features—in other words, you can bold,
italicize, and underline a single piece of text.
In the exercises that follow, you will learn different methods you can use to bold,
italicize, and underline. Bold with the Ribbon
Microsoft Excel provides two types of underlines. The exercises that follow illustrate them.
Single Underline:
Whenever you type text that is too long to fit into a cell, Microsoft Excel attempts to display
all the text. It left-aligns the text regardless of the alignment you have assigned to it, and it
borrows space from the blank cells to the right. However, a long text entry will never write
over cells that already contain entries—instead, the cells that contain entries cut off the long
text. The following exercise illustrates this.
EXERCISE 14
Work with Long Text
You can increase column widths. Increasing the column width enables you to see the long
text.
Change Column Width
You can also change the column width with the cursor.
1. Place the mouse pointer on the line between the B and C column headings. The
mouse pointer should look like the one displayed here , with two arrows.
2. Move your mouse to the right while holding down the left mouse button. The
width indicator appears on the screen.
3. Release the left mouse button when the width indicator shows approximately 20.
Excel increases the column width to 20.
Format Numbers
You can format the numbers you enter into Microsoft Excel. For example, you can add
commas to separate thousands, specify the number of decimal places, place a dollar sign in
front of a number, or display a number as a percent.
Format Numbers
To use functions, you need to understand reference operators. Reference operators refer to a
cell or a group of cells. There are two types of reference operators: range and union.
A range reference refers to all the cells between and including the reference. A range
reference consists of two cell addresses separated by a colon. The reference A1:A3 includes
cells A1, A2, and A3. The reference A1:C3 includes cells A1, A2, A3, B1, B2, B3, C1, C2,
and C3.
A union reference includes two or more references. A union reference consists of two or
more numbers, range references, or cell addresses separated by a comma. The reference
A7,B8:B10,C9,10 refers to cells A7, B8 to B10, C9 and the number 10.
Understanding Functions
Functions are prewritten formulas. Functions differ from regular formulas in that you supply
the value but not the operators, such as +, -, *, or /. For example, you can use the SUM
function to add. When using a function, remember the following:
Enclose arguments within parentheses. Arguments are values on which you want to perform
the calculation. For example, arguments specify the numbers or cells you want to add.
Use a comma to separate arguments.
In this function:
After you type the first letter of a function name, the AutoComplete list appears. You can
double-click on an item in the AutoComplete list to complete your entry quickly. Excel will
complete the function name and enter the first parenthesis.
Functions
12. Type C1:C3 in the Number1 field, if it does not automatically appear.
13. Click OK. The sum of cells C1 to C3, which is 300, appears. Format
worksheet
1. Move to cell A4.
2. Type the word Sum.
3. Select cells B4 to C4.
4. Choose the Home tab.
5. Click the down arrow next to the Borders button .
6. Click Top and Double Bottom Border.
As you learned in Lesson 2, you can also calculate a sum by using the AutoSum button
.
Calculate an Average
You can use the AVERAGE function to calculate the average of a series of numbers.
You can use the MIN function to find the lowest number in a series of numbers.
1. Move to cell A7.
2. Type Min.
3. Press the right arrow key to move to cell B7.
4. Type = MIN(B1:B3).
5. Press Enter. The lowest number in the series, which is 12, appears.
Note: You can also use the drop-down button next to the AutoSum button to calculate
minimums, maximums, and counts.
You can use the MAX function to find the highest number in a series of numbers.
You can use the count function to count the number of numbers in a series.
1. Move to cell A9.
2. Type Count.
3. Press the right arrow key to move to cell B9.
4. Choose the Home tab.
5. Click the down arrow next to the AutoSum button .
6. Click Count Numbers. Excel places the count function in cell C9 and takes a
guess at which cells you want to count. The guess is incorrect, so you must select
the proper cells.
7. Select B1 to B3.
8. Press Enter. The number of iteMicrosoft in the series, which is 3, appears.
Fill Cells Automatically
You can use Microsoft Excel to fill cells automatically with a series. For example, you can
have Excel automatically fill your worksheet with days of the week, months of the year,
years, or other types of series.
1. Click the Auto Fill Options button. The Auto Fill Options menu appears.
2. Choose the Copy Cells radio button. The entry in cells A1 and B1 are copied to all
the highlighted cells.
3. Click the Auto Fill Options button again.
4. Choose the Fill Series radio button. The cells fill as a series from Sunday to
Saturday again.
5. Click the Auto Fill Options button again.
6. Choose the Fill Without Formatting radio button. The cells fill as a series from
Sunday to Saturday, but the entries are not bolded.
7. Click the Auto Fill Options button again.
8. Choose the Fill Weekdays radio button. The cells fill as a series from Monday to
Friday.
Some of the entries in column B are too long to fit in the column. You can quickly adjust the
column width to fit the longest entry.
1. Move your mouse pointer over the line that separates column B and C. The Width
Indicator appears.
After you complete the remainder of the exercise, your worksheet will look like the one
shown here.
Fill Times
Creating a chart
Charts can be a useful way to communicate data. When you insert a chart in Excel, it appears
in the selected worksheet with the source data by default.
To create a chart:
• Select the worksheet you want to work with. In this example, we use the
Summary worksheet.
• Select the cells you want to chart, including the column titles and row labels.
• Click the Insert tab.
• Hover over each Chart option in the Charts group to learn more about it.
• Select one of the Chart options. In this example, we'll use the Columns command.
• Select a type of chart from the list that appears. For this example, we'll use a 2-D
Clustered Column. The chart appears in the worksheet.
Identifying the parts of a chart
Have you ever read something you didn't fully understand but when you saw a chart or
graph, the concept became clear and understandable? Charts are a visual representation of
data in a worksheet. Charts make it easy to see comparisons, patterns, and trends in the data.
Source data
The range of cells that make up a chart. The chart is updated automatically whenever the
information in these cells changes.
Title
The chart key, which identifies what each color on the chart represents.
Axis
The vertical and horizontal parts of a chart. The vertical axis is often referred to as the Y axis,
and the horizontal axis is referred to as the X axis.
Data series
The actual charted values, which are usually rows or columns of the source data.
Value axis
The axis that represents the values or units of the source data.
Category axis
Chart tools
Once you insert a chart, a new set of Chart Tools, arranged into three tabs, will appear above
the Ribbon. These are only visible when the chart is selected.
Lab Task:
Calculate the total, average, maximum, and minimum sales from a list of monthly sales data.
Home Task
Task 1:
Multiples Generator:
Create a sheet that takes up three numbers and then generates the first 20 multiples of the
numbers. Enter your original numbers into the orange cells (shown in the image). You may
enter up to 3 numbers. The first 20 multiples of your numbers will then be displayed in the
rows below.
Task 2:
ATTENDANCE SHEET:
Create a sheet as shown below. The sheet determines the count of “P‟ for each student. Also
use a formula to calculate percentage.
Task 3:
You are tasked with creating an Excel template to manage employee records for a diverse
company with multiple departments. Explain how you would design the template to
incorporate formatting, filters, links, comments, pictures, and other relevant data to ensure
efficient management and easy accessibility of employee information. Provide specific
examples of how each feature would enhance the functionality and usability of the template.
Also apply AI features such as analyse data and forecasting data and explain these.
Task 4:
TRIGONOMATRIC GRAPHS
Draw a sine (sinƟ) wave and a cosine (cosƟ) wave on a single graph. Angle (Ɵ) ranges from
0o to 3600 with the interval of 150.
Attach the formula sheets also for the sine and cosine chart