You are on page 1of 21

MS EXCEL

Lab Exercise : 1
Objective:
The purpose of this exercise is to create employees salary sheet.

Instructions:
The following options & formulas of MS-Excel will be used in this exercise.

1. =sum(range), =if(), =sumif(), =countif()

2. Data  Data Validation

Questions:

1. Type the following worksheet.

2. In “Basic Salary” column values greater than 10,000 not allowed


3. Calculate House Rent (if Basic Salary is greater than 5000 then 45% otherwise 30%)
4. Calculate Conv. Allowance (if Basic Salary is greater than 5000 then 30% otherwise 20%)
5. Calculate Medical Allowance (if Basic Salary is greater than 5000 then 60% otherwise 45%)
6. Calculate Gross Pay
7. Calculate Tax (if Gross is greater than 15000 then 10% otherwise 0)
8. Calculate Net Pay
9. Calculate total salary of those employees whose salary is less than 5000
10. Count no. of employees who are not giving tax

[Type text] Page 10


MS EXCEL

Lab Exercise : 2
Objective:
The purpose of this exercise is to create students Marks sheet.

Instructions:
The following options & formulas of MS-Excel will be used in this exercise.

1. =sum(range), =if(), =countif()

2. Data  Data Validation

Questions:

1. Type the following worksheet.

2. In M1 and M2 columns value greater than 15 not allowed


3. Calculate Mid-Total, Total
4. Calculate Grade using If condition
5. Calculate no. of D and F grades.
6. Add a column for Remarks after grade column
7. Calculate Remarks using if condition

[Type text] Page 11


MS EXCEL

Lab Exercise : 3
Objective:
The purpose of this exercise is to find out data using VLOOKUP formula.

Instructions:
The following formulas of MS-Excel will be used in this exercise.

1. =vlookup(), =countif()

Questions:

1. Type the following worksheet.

2. You have to find out the city, departure time and terminal of Flight No. LH 5842 using vlookup
formula
3. Find out the no. of flights coming on terminal 2 using formula.

[Type text] Page 12


MS EXCEL

Lab Exercise : 4
Objective:
The purpose of this exercise is to calculate grades using VLOOKUP formula.

Instructions:

The VLOOKUP() formulas will be used in this exercise.

Questions:

1. Type the following worksheet.

2. Calculate grades using vlookup formula.

[Type text] Page 13


MS EXCEL

Lab Exercise : 5
Objective:
The purpose of this exercise is to find out data using HLOOKUP formula.

Instructions:

The HLOOKUP() formulas will be used in this exercise.

Exercise:

1. Type the following worksheet.

11/16/200 11/17/200 11/18/200 11/19/200 11/20/200 11/21/200


  5 5 5 5 5 5
sales $2,885 $1,838 $1,524 $1,580 $1,753 $2,632
costs $2,162 $1,578 $1,564 $1,609 $2,472 $1,981

2. you have to find out sales and cost of “11/19/2005”

[Type text] Page 14


MS EXCEL

Lab Exercise : 6
Objective:
The purpose of this exercise is to filter out information from worksheet.

Instructions:

The following option of MS-Excel will be used

DATA  FILTER

Exercise:

1. Type the following worksheet.

EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTN


O
7788 SCOTT ANALYST 5-Mar-84 3000 20
7902 FORD ANALYST 7782 5-Dec-83 3000 20
7369 SMITH CLERK 7902 13-Jun-83 800 20
7876 ADAMS CLERK 7698 4-Jun-84 1100 20
7900 JAMES CLERK 7566 23-Jul-84 950 30
7934 MILLER CLERK 7782 21-Nov-83 1300 10
7566 JONES MANAGER 7839 31-Oct-83 2975 20
767698 BLAKE MANAGER 7839 11-Jun-84 2850 30
7782 CLARK MANAGER 7566 14-May-84 2450 10
7839 KING PRESIDEN 7698 9-Jul-84 5000 0 10
T
7499 ALLEN SALESMA 7698 15-Aug-83 1600 300 30
N
7521 WARD SALESMA 7698 26-Mar-84 1250 50 30
N
7654 MARTIN SALESMA 7698 5-Dec-83 1250 1400 30
N
7344 TURNER SALESMA 7788 4-Jun-84 1500 30
N

2. Show all Managers


3. Show all Managers & Clerks

[Type text] Page 15


MS EXCEL

4. Show all employees whose salary is less than 2000


5. Show all employees whose salary is between 1500 to 2500
6. Show all employees who are working in department no. 30 and salary is less than 2000

Lab Exercise : 7
Objective:
The purpose of this exercise is to extract information from worksheet.

Instructions:

The following option of MS-Excel will be used

DATA  ADVANCED

Exercise:

1. Use LAB 6 worksheet

2. Show all Managers


3. Show all Managers & Clerks
4. Show all employees whose salary is less than 2000
5. Show all employees whose salary is between 1500 to 2500
6. Show all employees who are working in department no. 30 and salary is less than 2000
7. Show all employees whose names starts with “A” & “S”

[Type text] Page 16


MS EXCEL

Lab Exercise : 8
Objective:
The purpose of this exercise is to extract information from worksheet.

Exercise:
1. Arrange data in ascending order with respect to the column of Murder in the given data.
2. Arrange data in ascending order with respect to Region and then with respect to State in the
given data.

Instructions:
1. Highlight the column headings for columns A through G.

2. Open the Data menu and select the Sort… option. (Note: At the top-right of the Sort Options
screen the My List Has No Header Row option is selected. Since the first row of the spreadsheet
has data labels we do not want these labels to be sorted with the data, select My list has Header
Row.

3. Click on the down arrow button in the Sort By option. This provides a list of all the variable labels
in the first row of the spreadsheet. Select the MURDER label, select the Descending option, and
then click on the OK button. The data in the spreadsheet is now arranged from the highest to
the lowest value.

4. For a different sort, highlight the column headings, open the Data menu, and select the

5. Sort… option.

6. In the Sort By… option select REGION and the Ascending option. In the Then Sort By… option
select STATE and the Ascending option. Then click on the OK button. The data is now sorted by
region, and within each region is arranged in alphabetical order by state abbreviation.

7. Save the spreadsheet and exit Excel.


Note:
If you sort data within a single column, it only sorts the data in that field. It will not rearrange
the rows.

[Type text] Page 17


MS EXCEL

Home Work:
1. Arrange states who have witnessed least to maximum robbery.
2. Arrange states who have witnessed least to maximum robbery for each region in alphabetical
order.

[Type text] Page 18


MS EXCEL

Lab Exercise : 9
Objective:
To help students in applying formulas or functions (either built-in or creating your own)

Exercise:
Cost-Benefit Analysis by using formulas and functions

Instructions:

1. Enter the information in the spreadsheet below. Be sure that the information is entered in the same
cells as given, or the formulas will not work. The information is the stream of costs and benefits (in
millions) estimated for a proposed city baseball stadium. Year 0 represents the initial investment
while costs for years 1-10 are the maintenance costs incurred at the end of each year. The benefits
are the revenues from sport team contracts and revenues at the end of each year.
2. Highlight the cell range B4:D14.
3. Open the HOME menu, select Number... Select the category CURRENCY, select the format
$1,234.10(fig 1). Repeat this procedure for the cell range F4:F16.
4. Highlight cell B18. Open the FORMAT menu, select CELLS... Select the category PERCENT, select two
decimal places.
5. Calculate the Total Benefit for each year of the project. To do
this, enter the following formulaD4: =c4-b4
6. Copy the formula in cell D4 to the cell range D5:D14.
7. Enter the following value for the discount rate (a 10%
discount rate) in B18 = 0.1
8. Calculate the discount factor for each year. Enter the
following formula. E4: =1/(1+$b$18)^a4
9. Copy the formula in cell E4 to the cell range E5:E14.
10. Multiply the total benefit for each year by the discount factor
for each year. Enter the following formula. F4: =d4*e4
11. Copy the formula in cell F4 to the cell range F5:F14.
12. Find the Net Present Value. Add together the Present Values for each year. Enter the following
formula. F16: =sum (f4:f14)
13. To calculate the average benefits gain in 10 years. Enter the following formula. F17: =Average
(d4:d14)
14. To calculate the minimum benefits gain in 10 years. Enter the following formula. F18: =Min(d4:d14).
15. To calculate the maximum benefits gain in 10 years. Enter the following formula. F19: =Max(d4:d14).

[Type text] Page 19


MS EXCEL

Home Work:

Pak Motors(ptv)

item labour capital extra cost gross net sale profit


cost cost amount amount price
motor 500 10500 1000        
bike
car 1200 140000 2000        
luxury car 1500 450000 8000        
high roof 1600 150000 4000  
     

i) Calculate gross amount by adding labor, capital, and extra.


ii) Calculate net amount=gross amount - 2% of Gross amount
iii) Calculate sale price=30 % of net amount+ net amount
iv) Find the profit for each item.
v) Which item gains the maximum, minimum profit?

[Type text] Page 20


MS EXCEL

vi) What is the average profit gain of pak motors on its items?

[Type text] Page 21


MS EXCEL

Lab Exercise : 10
Objective:
To generate a table that displays the contents of one or several variables at the same time. Since, the
table is dynamic therefore one can add, remove and change the location of elements in the table. Excel
will automatically give a new view on the data.

Instructions:
1. Place the cursor on any cell between A1 and G16; where the database is located.
2. From the Insert menu, select the PivotTable option.
3. To select the data for pivot table make sure that the cells selected are
between A1 and G16.
and then press the Next button.
4. To save the pivot table, select the New worksheet option.
5. Layout of pivot table will open. This allows you to create immediately a pivot table. You can
place the fields that you need, located on the right, into four different areas: page, row, column
and data.

6. From the Pivot table's field list, select the Salary field.

7. Press and hold the left mouse button and move the field into the
Value area.
Release the mouse button as soon as the square for the Salary
field is over the Data area.

To distribute the total amount by occupation within the company.

8. Now select the Title field, bring it to the Row /column area. total of salaries by title and by
gender
9. The new table shows the total of salaries by occupation (title: Manager, Worker...) with always a
grand total of 394 400 $.
To show the total of salaries by title and by gender.
10. select the Gender field
11. Press and hold the left mouse button and move the field in the Column/Row area.
12. If both the fields are in column they show a different view as compare to the view where one
field is in row and the other is in column area. This shows the dynamic attribute of pivot table.

[Type text] Page 22


MS EXCEL

Exercise:
1. To list the employees with respect to gender.
2. To list the employees with respect to the salary brackets of 20-25,26-30,31-35,36-40.Also
display it with graph.

[Type text] Page 23


MS EXCEL

Lab Exercise : 11

1. Enter the data on states provided in the attached spreadsheet on page 9.


2. If you were interested in printing this data, you would open the File menu and select the Print
command. For now, let’s just see what the spreadsheet would look like if we printed it in its
current form. Open the File menu and select the Print Preview command. This shows you what
the file would look like if you printed it in its current form.
3. Click on the Next button to see the second page of the print out.
4. To view the entire page on the screen the text must be rather small. To get a better look at the
data, click on the Zoom button. To return back to the full page view, click on the Zoom button a
second time.
5. Click on the Close button to get out of Print Preview.
6. Let’s dress up this print out. Open the File menu and select the Page Setup… command.
7. The Page options should appear on your screen. Click on the tab labeled Sheet.
8. In the space next to the Print Titles: Rows to Repeat at Top enter the cell range A1:F1.
9. Click on Margins tab and select the option Center on Page: Horizontally.
10. Click on the Header/Footer tab. The default header for the spreadsheet is the title of the
spreadsheet. To create a more description title on the print out, click on the Custom Header
button. In the center section type the title Selected State Data.

11. When you are finished making all of the changes you would like to make, simply click on the OK
button. To see what the printed spreadsheet would now look like, open the File menu and select
the Print Preview… command.
12. Only two states appear on the second page which is a waste of paper. To help save a tree, or at
least a twig or two, the spreadsheet can be fit on to one page. To do this, open the File menu
and select the Page Setup… option. Under the Page options click on Fit to 1 page(s) wide by 1
tall option. Now click on the OK button to accept this change.
13. Open the File menu and select the Print Preview command. Notice the data for all the states
now fits on one page. A printed version of the changes made above is provided on
page 4 of this handout.

[Type text] Page 24


MS EXCEL

Q2.
Testes weight (mg)
Mouse sum of mean produc
strain Mean SEM and sem t
Strain A 142 12 154 2840
Strain B 82 3 85 3280
Strain C 60 5 65 1500
Strain D 38 1 39 380

i) compute the sum of mean and


sem.
ii) take out the product such that if strain is A then mean*20,strain=B then mean*40,strain Cthen mean*25,Strain
D then mean multiply by10
ii) create a column chart by using colums mouse strain, mean
,sem

Category Name Jan Feb Mar Apr May June


Ads 38520 36000 30300 22500 45000 26700
Commission 77040 72000 60600 45000 90000 53400
Insurance 3852 3600 3030 2250 4500 2670
Interest Exp 2182.8 2040 1717 1275 2550 1513
Meals & Entertn 6420 6000 5050 3750 7500 4450
Office 3852 3600 3030 2250 4500 2670
Postage / Delivery 2568 2400 2020 1500 3000 1780
Printing / Reproduction 6420 6000 5050 3750 7500 4450
Rent - Office 2568 2400 2020 1500 3000 1780
Returns 38520 36000 30300 22500 45000 26700
Tax 5000 4500 5500 47000 3000 198300
Trip Costs 642000 600000 505000 375000 750000 445000
Wages 2140 2000 2000 2000 2000 2000

[Type text] Page 25


MS EXCEL

Animal Number Cost Sex Total cost


$
dog 3 $ 15.00 male 45.00
$
cat 5 $ 2.00 female 10.00
$
mouse 150 $ 0.50 male 75.00
$
horse 2 $ 150.00 female 300.00
$
rat 300 $ 0.75 female 225.00

$1,500.0
cow 20 $ 75.00 male 0
$
pig 35 $ 1.00 female 35.00
$
chicken 15 $ 35.00 male 525.00
$
sheep 10 $ 35.00 female 350.00
$
kangaroo 3 $ 55.00 male 165.00
$
wombat 5 $ 45.00 male 225.00

[Type text] Page 26


MS EXCEL

Objective:
The purpose of this exercise is to understand SQL – Data Manipulation Language (DML) .

Instructions:
Data Manipulation Language (DML) statements are used for managing data within schema objects

a. INSERT - insert data into a table


b. UPDATE - updates existing data within a table
c. DELETE - deletes all records from a table, the space for the records remain
d. SELECT - retrieve data from the a database

Insert:
Structure:
INSERT INTO table_name VALUES (value1, value2, value3,...)
OR
INSERT INTO table_name (column1, column2, column3,...) VALUES (value1, value2, value3,...)

Examples
P_Id LastName FirstName Address City
1 Hansen Ola Timoteivn 10 Sandnes
2 Svendson Tove Borgvn 23 Sandnes
3 Pettersen Kari Storgt 20 Stavanger
Persons Table

INSERT INTO Persons VALUES (4,'Nilsen', 'Johan', 'Bakken 2', 'Stavanger')

INSERT INTO Persons (P_Id, LastName, FirstName) VALUES (5, 'Tjessem', 'Jakob')

Timoteivn 10

Persons Table after addition of two records

[Type text] Page 27


MS EXCEL

Update:

Structure:
UPDATE table_name SET column1=value, column2=value2,... WHERE some_column=some_value

Example:

UPDATE Persons
SET Address='Nissestien 67', City='Sandnes'
WHERE LastName='Tjessem' AND FirstName='Jakob'

Delete:

Structure:
DELETE FROM table_name WHERE some_column=some_value

Example:
DELETE FROM Persons WHERE LastName='Tjessem' AND FirstName='Jakob'

Select:
Structure:
SELECT * FROM TABLENAME WHERE CONDITION

Examples:
Select all citizens from sandnes
SELECT * FROM Persons WHERE City='Sandnes'

Select all persons with First name “Tove”


SELECT * FROM Persons WHERE FirstName='Tove'

Select only the persons with the first name equal to "Tove" AND the last name equal to "Svendson"
SELECT * FROM Persons WHERE FirstName='Tove' AND LastName='Svendson'

select only the persons with the first name equal to "Tove" OR the first name equal to "Ola":
SELECT * FROM Persons WHERE FirstName='Tove' OR FirstName='Ola'

Select the persons living in a city that ends with an “s"


SELECT * FROM Persons WHERE City LIKE ‘*s’
List Persons where P_ID between 1 to 3
SELECT * FROM Persons WHERE P_ID BETWEEN 1 AND 3

[Type text] Page 28


MS EXCEL

Exercise:
Sample Table: empinfo
city
Payson
Payson
San Diego
Phoenix
Cottonwood

1) Display the first and last names for everyone whose last name ends in an “es".
2) Display all columns for everyone whose first name contains "Mary".
3) Display all columns for everyone whose age is between 20 to 35
4) Select the last name of all employees, without duplicates.
5) Select all the data of employees whose last name is “Howell”.
6) Select all the data of employees live in Payson.
7) Select all the data of employees that live in Payson and first name start with J.
8) Select all the data of employees that not live in Arizona and first name start with E and id start
with 8.

[Type text] Page 29

You might also like