You are on page 1of 70

STUDY MATERIAL

INFORMATION TECHNOLOGY FOR


MANAGERS
(IM501)
(3 Credits)

PGDM (EXECUTIVE) 2021-22


Term 1

Readings and Exercises

Instructor: Prof. Himanshu Joshi

International Management Institute


B-10, Qutab Institutional Area, Tara Crescent,
New Delhi – 110 016
Table of Contents Pages

Course Outline .............................................................................. 3-8


Introduction to Excel as an Analytical Tool ............................... 9-17
Using Formulas and Functions ................................................... 9-17
Managing Marketing Data & its Applications .......................... 18-24
Managing Financial Data & its Applications ............................ 25-32
Sensitivity Analysis Using Excel .............................................. 25-32
Managing Operation Data & its Applications ........................... 33-40
Introduction to Power Pivot ...................................................... 41-43
Introduction to Macros.............................................................. 44-45
Introduction to Databases for Effective Data Management ...... 46-70

ITM (Page - 2)
Course Outline: Information Technology for Managers
Course code: IM 501
Credit:3 , Core Course
Area: Information Management
Program: PGDM-Executive
Term I Academic Year 2021-22
_______________________________________________________________________
Instructor(s) Himanshu Joshi Click or tap here to
Name enter text.
Room no. 312 Click or tap here to
enter text.
Email himanshu@imi.edu Click or tap here to
enter text.
Phone (Extn no.) 9873906447 Click or tap here to
enter text.
Meeting Hours appointment (by Click or tap here to
email or phone) enter text.
______________________________________________________________________
1. COURSE DESCRIPTION

In today’s volatile and competitive business environment, organizations face the challenge to
groom mid-level and senior executives to attain top leadership positions. While functional and
domain expertise is crucial for these executives, their success is also contingent on their ability to
effectively make use of commonly available information technology (IT) tools for quick decision
making.
A generation ago computers were first introduced into businesses and organizations to automate
clerical functions and routine transactions. Today, information technology (IT) is an integral part
of any manager’s daily life and forms the backbone for every managerial function of the modern
organization. The speed and flexibility it provides, enables organizations to remain competitive
and sustainable. Whether it be integrating the organization through enterprise system, developing
customer relationship management systems or human resource management system, or executing
financial transaction in electronic markets, information technology helps in linking all the different
functions together in an integrated way and getting information to decision makers at the right time
and in the right format.
The course prepares students to leverage information technology effectively. The course focuses
on the opportunities and challenges posed by information technology, how they affect the world
and what managers need to know for effective decision making through information technology.
The course introduces students to office automation packages like electronic spreadsheet.

ITM (Page - 3)
COs >>
2. COURSE OUTCOMES (COs) COs and POs >>
COs, POs and CECs >>
After going through the course, the students would be able to:
Course Outcome 1 (CO1): Explain organizational data that can be used to support
managerial decision making.
Course Outcome 2 (CO2): Apply spreadsheet functions and formulas for supporting business
operations and managerial decision-making at workplace.
Course Outcome 3 (CO3): Evaluate the results based on multiple perspectives.
COs >>
COs and POs >>
COs, POs and CECs >>

3. MAPPING OF THE PROGRAM OUTCOMES (POs) AND COURSE OUTCOME (COs)

Course Outcomes
(COs)
Program Outcomes (POs)
CO1 CO2 CO3

PO1: Student should be able to demonstrate critical thinking skills to 3 3 3


analyze managerial decision-making challenges.
PO2: Student should be able to create a solution to managerial 3 3 3
decision-making challenges while evaluating the same from multiple
perspectives.
PO3: Student should be able to illustrate the role of responsible
leadership in management.
PO4: Student should be able to identify social concerns and ethical
issues in management.
PO5: Student should be able to identify challenges faced by the
organization at the global level.
PO6: Student should be able to take decisions in the global business
environment.
PO7: Student should be able to identify business issues suitable for
applying the acquired knowledge from management theory and
practice.
PO8: Student should be able to develop an action plan to provide a
solution to the business issues.

4. PEDAGOGY

The course will be taught with a blend of presentations, interactive lectures, and discussions. It
will be supplemented by assignments, and practical exercises.

ITM (Page - 4)
5. COURSE EVALUATION COMPONENTS (CECs)
The final Grade will be calculated as follows:

Assignments (25%): The assignments will be given and is required to be done in a group
with the dual purpose of practicing problem solving as well as evaluating decision
alternatives.

Quizzes (35%): The quizzes will be based on the course covered in the previous classes.
There will be n quizzes (n will be decided by the faculty) spread across the entire course.
Quizzes will mostly be computer lab-based exercises.

End Term (40%): End term exam will cover all the topics. Questions asked will cover
questions from various areas of management to test the problem-solving ability of the student.
COs >>
6. MAPPING BETWEEN COs, POs and CECs COs and POs >>
COs, POs and CECs >>

Course Evaluation Components (CECs)


COs POs
Assignments Quizzes End Term
CO1 PO1, PO2 √
CO2 PO1, PO2 √
CO3 PO1, PO2 √

7. RESOURCES
7.1 Textbook

 Succeeding in Business with MS Excel 2013 – A Problem Solving Approach by Debra


Gross, Frank Akaiwa and Karleen Nordquist (Cengage Learning)

 Exercise Book

7.2 Reference Books

 Microsoft Office Excel 2013 – Data Analysis and Business Modeling by Winston L.
Wayne, Microsoft Press, Prentice Hall India
 Microsoft Office Excel 2013 – Building Data Models with PowerPivot – Microsoft PHI
by Alberto Ferrari and Marco Russo
 Analyzing Data with Microsoft Power BI and Power Pivot for Excel – Microsoft PHI by
Alberto Ferrari and Marco Russo
 Decision Making Using Microsoft Excel by Albright, Winston, Zappe, Cengage Learning
 Accessing & Analyzing Data with MS-Excel by Cornell, PHI.

ITM (Page - 5)
7.3 Online References (if any)

1. http://www.seu.ac.lk/cedpl/student%20download/Excel%202010%20Bible.pdf
2. http://gegeek.com/documents/eBooks/MS%20Excel%202013%20Plain%20and%20Simp
le.pdf
3. http://www.seu.ac.lk/fac/student%20download/MS%20Excel%202010%20Step%20by%
20step.pdf
4. www.gcflearnfree.org/excel2010/
5. http://www.goodwin.edu/computer_resources/pdfs/excel_2010_tutorial.pdf
6. http://www.usd.edu/academics/center-for-teaching-and-learning/upload/Excel-3-
Formulas-and-Functions.pdf
7. http://spreadsheets.about.com/od/excelformulas/ss/2010-12-25-excel-2010-basic-tutorial-
pt1.htm
8. Power Pivot - https://support.office.com/en-us/article/Start-the-Power-Pivot-in-
Microsoft-Excel-add-in-a891a66d-36e3-43fc-81e8-fc4798f39ea8
9. http://sqlmag.com/sql-server-2012/understanding-powerpivot-and-power-view-
microsoft-excel-2013
10. http://video.ch9.ms/sessions/teched/eu/2014/Labs/DBI-H318.pdf
11. Book -
https://ptgmedia.pearsoncmg.com/images/9780735676343/samplepages/9780735676343.
pdf
12. http://www.excel-2010.com/
13. http://www.easyexcelvba.com/
14. http://www.excel-vba.com/excel-vba-solutions-beginners.htm
15. http://www.excel-easy.com/vba/create-a-macro.html
16. http://www.learnexcelmacro.com/excel-macro-tutorial/
17. MS Access Video Tutorials - http://www.access-programmers.co.uk/microsoft-access-
tutorials/
18. http://wps.aw.com/wps/media/objects/8911/9125833/labs/newlabs/lab10s.pdf
19. http://www.itu.dk/~slauesen/UID/AccessTutorial.pdf

ITM (Page - 6)
8. SESSION PLAN

Session Topics Readings/Exercises


No.
1-2 Introduction to Excel as an Analytical (Refer to Chapter 1, 2, & 3 of
Tool Textbook)
 Managing and Representing Data
for Analysis
 Importing Data from Varied
Sources
 Data Validations & Checks
 Consolidating varied Data
 Conditional Formatting
 Visualizing Data

3-4 Excel Formulas & Functions (Refer to Chapter 4 & 7 of


 Excel Functions & Formulas Textbook)
 Logical Functions
 Text Functions
 Using Statistical Tools &
Functions

5-6 Managing Marketing Data & its (Refer to Chapter 5 & 7 of


Applications Textbook)
 Organizing, extracting and reporting
data
 Retrieving data from
Multidimensional tables
 Analyzing data for 360o view
 Slicing and Dicing Data

7-8 Managing Financial Data & its (Refer to Chapter 6 of


Applications Textbook)
 Using Financial Functions
 Loan Payment
 Understanding Cash Flows
 Computing Net Present Value and
Internal Rate of Return

9-10 Sensitivity Analysis using Excel (Refer to Chapter 8 & 10 of


 Goal Seek Textbook)
 What-if Analysis
 Sensitivity Analysis

ITM (Page - 7)
11-12 Managing Operations Data and its (Refer to Chapter 9 of
Applications Textbook)
 Optimization Tools and
Techniques

13-14 Introduction to Power Pivot (Refer to Reading Material)


 Creating a Data Model in Excel
 Loading Data Models
 Data Analysis using Power Pivot

15-16 Introduction to Macros (Refer to Chapter 10 of


 Recording of Macros Textbook)
 Automating manual tasks using
excel macros.
 Creating Programs using Excel
VBA

17-20 Introduction to Databases for Effective (Refer to Reading Material)


Data Management
 Database concepts &
Applications
 Designing of Databases
 Data Types & Sourcing Data
 Defining Relationships
 Query Handling
 Reporting and Switch boarding
 Loading Data into Excel from
Access using VBA

9. ACADEMIC INTEGRITY & CLASS RULES

a) Plagiarism is the use of or presentation of ideas, works that are not one’s own and which
are not common knowledge, without granting credit to the originator. Plagiarism is
unacceptable in IMI and will invite penalty. Type and extent of penalty will be at the
discretion of the concerned faculty.
b) Cheating means using written, verbal or electronic sources of aid during an examination/
quiz/ assignment or providing such assistance to other students (except in cases where it is
expressly permitted by the faculty). It also includes providing false data or references/list
of sources which either do not exist or have not been used, having another individual write
your paper or assignment or purchasing a paper for one’s own submission. Cheating is
strictly prohibited at IMI and will invite penalty as per policies of the Institute .

ITM (Page - 8)
Introduction to Excel as an Analytical Tool
Excel Formulas and Functions
(Sessions 1-2-3-4)
Reference: Chapter 1, 2, 3, 4 & 7 of Textbook

1) Cell Referencing: In excel, you refer another cell or range of cells in your formula. This cell
reference can either be absolute, relative or mixed mode reference.

2) Consolidating Data: If you have worksheets that are identical to each other (except the values),
the data consolidation feature can be used to consolidate the worksheets into a summary report.

3) Performing Calculations using Formula: Formulas are mathematical equations.

4) Functions: A function is just a built-in formula. Functions have been added to excel to simplify
performing specific mathematical operations in the spreadsheet. There are nine categories of
functions in Excel (Financial, Date & Time, Math & Trig, Statistical, Lookup & Reference,
Database, Text, Logical, and Information)

4.1 Date & Time Function

A Date & Time function is a function that assigns a serial number to date and time data in order to
use the data in a calculation. Commonly used are Day, Month, Year, Weekday, Now, Today,
DateDif() etc.

4.2 Text Functions

It helps you to format the data in the way you want. Available text functions are LEFT, RIGHT,
MID, TRIM, LEN, FIND, SEARCH, REPLACE, CONCATENATE, VALUE)

4.3 Logical Function:

IF Function: IF function is a logical function that performs a calculation only if the criteria is met.
There are six logical function (AND, OR, IF, NOT, TRUE and FALSE). Based on whether the
criteria is true or false, the value is calculated. It is possible to nest multiple IF functions within
one Excel formula. You can nest up to 7 IF functions to create a complex IF THEN ELSE
statement.

ITM (Page - 9)
OR Function: The OR function returns TRUE if any condition is TRUE. It returns FALSE if all
conditions are FALSE.

AND Function: The AND function returns TRUE if all conditions are TRUE. It returns FALSE
if any of the conditions are FALSE.

The OR and AND Function can only determine if the condition is true or false. By combining it
with IF function; it increases the capabilities of spreadsheet.

NOT Function: The NOT function returns the reversed logical value.

4.4 Conditional Functions: These functions allow you to perform a calculation only if a certain
condition is met. These include COUNTIF, SUMIF, AVERAGEIF

4.5 Database Functions: Excel provides a number of database functions which help in
extracting information from your database. For example, counting how many students met certain
conditions, add up certain information depending on some conditions. The important thing about
database functions is that it allows you to specify the criteria within the spreadsheet itself. These
include DSUM, DAVERAGE, DCOUNT etc.

4.6 LOOKUP Function: Lookup functions help you to “look-up” for values from worksheet
ranges. Excel allows you to perform both vertical Lookup and horizontal Lookup using VLookup
and HLookup functions. Majority of instances where Lookup functions are used employ VLookup
functions.

MATCH Function: Match function returns the location of the occurrence of the given text in an
array. Suppose you have been given the Sales data for products during various months. Use the
sheet named Match to identify the location of Product and Month in the given array.

INDEX Function: Index function returns the value occurring at a specified location in an array.
For example, value at the intersection of a row and column combination.

Note that the two functions INDEX and MATCH are somewhat opposite in their tasks: INDEX
returns a value occurring at a specified location in a specified vector or a matrix, whereas MATCH
returns the location in a vector where a given value occurs.

OFFSET Function: An Offset function is used to create a reference to a range, that is a specified
number of columns and rows away from a cell or a range of cells.

=OFFSET (reference, rows, cols, [height], [width])

where

ITM (Page - 10)


reference - The starting point, supplied as a cell reference or range.; rows - The number of rows to
offset below the starting reference; cols - The number of columns to offset to the right of the
starting reference; height - [optional] The height in rows of the returned reference; width -
[optional] The width in columns of the returned reference.

4.7 Correlation, Regression and other Statistical Functions: Excel provides you with a number
of statistical functions to perform statistical analysis on the data. Example: A teacher needs to
determine the average grade for each of her students. A grocery store wants to find out what the
variation is between their sale price and the competition’s.

Mean, Median, Mode, Standard Deviation, Variance, Frequency, Correlation, Regression etc.
Descriptive Analysis as part of Analysis Toolpak (Excel Add-in) presents various statistics in a
snapshot.

Correlation: A correlation is a single number that describes the degree of relationship between
two variables.

Regression: A linear regression is just a statistical tool used to determine whether or not two (or
more) variables are linearly related. The general form of the relationship is given by the formula
Y = a + bX + error.

5) Conditional Formatting: It helps you to specify formatting for range of cells based upon
criteria or contents of cell range. Conditional formatting is available under Home tab.

Exercise – 1
Q1) ABC Business School conducts different kinds of vocational certification courses and
each course that they offer is restricted to maximum 10 students. As part of the certification
process they conduct number of quizzes, give couple of assignments to the students and also
conduct the final exam at the end of the course. Each component of the evaluation is done out
off 100 marks, but each component carries a different weightage. The total marks scored by
each student are to be calculated keeping the weightage for each component in mind. The
examination section of the ABC Business School is not organized well and they capture the
data about the students and their performance in a disorganized manner as given in the three
sheets of Exercise-1.xlsx. The data in Students worksheet is about their performance in various
components; The Name worksheet has the names of the students and the Grades worksheet
consists of Grading Policy of the School. You have been hired by ABC Business School to
manage the data and generate various reports using the relevant data from all the three
worksheets.

1.Organize the data that is spread across three sheets for reporting:
ITM (Page - 11)
a. Create a unique ID for each student by and combining Student ID, Program and
Section.
b. Display the student first name and last name in Student sheet.
c. Concatenate the first name and last name with an empty space in between.
d. Use appropriate function to extract Student ID, Program and Section from the
unique id.
2. Calculate the total marks for each student based on the weightages.
3.A Student is declared “Pass” if the total mark scored by the student is more than 75
otherwise “Fail”.
4. Give a rating of Good, if the total marks is more than or equal to 60 and at least one of the
component marks is greater than or equal to 35. Give a rating of Poor otherwise.
5. Find the grade for each student based on the total marks obtained using the grading policy.
6. Compute the following Statistics about the class performance:
a. Average Marks scored in each component
b. Max Marks scored in each component
c. Minimum Marks Scored in each Component
d. Count the Number of students for each of the components
7.Using DOB of students:
a. Extract the day of DOB
b. Extract month of DOB
c. Extract year of DOB
d. Extract Day of the week from DOB
8.Using the system date, find the Age of each Student in terms of days, months and year.
9. How many students have scored more than 50 in Assign1?
10. Compute the class average for those students who have scored at least 60 marks.
11. Compute the total marks by including only those component marks where the student has
scored more than 35.
12. Compute the average marks of those students who born in the month of May.
13. Create a rule to identify duplicate values in the DOB column.
14. Highlight in Blue color where the Total >70 and in red color where Total < 35
15. Highlight cells in which total scores increased over previous student in one color
and in which scores decreased over previous student in another color.
16. Create a rule to identify total score which are greater than average scores.
17. Create a rule to identify total scores value is less than 35 to display a down arrow, from
35 to 60 to display a horizontal arrow, and 60 or greater to display an up arrow.
18. Highlight all Saturdays and Sundays in red.
19. What is the average score of female students who have scored more than 40 in Quiz?
20. Find the total number of employees in the dataset with age more than 25 years.
21. Find the number of students born in the year 1991 and have scored more than 60.

ITM (Page - 12)


Q2) You have the sales data for East and West Region for January, February and March months.
Use the Data Consolidation feature to create the summary report.

Q3) You have been given the Product ID and the price. Given a productID, find the product price?

Q4) Write a formula based to compute tax rates based on income levels given below
0-9999 15%
10,000-29,999 30%
30,000-99,999 34%
100,000 and above 40%

Q5) Suppose the product price changes over time. You have the date when the product was sold.
How can I write a formula to compute product’s price.
Date sold Price
Jan – April 2005 98
May-August 2005 105
September-December 2005 112

Q6) The sales for the products tea, coffee and sugar have been provided in excel for the first four
months of the year. Use to appropriate function to identify the position of various products and
months in their respective arrays.

Q7) Problem - Computation of shipping cost: A company supplies its product to four cities from
five warehouses. The shipping plan is given to you in sheet named Index. For example, it is planned
to ship 150 units from ware house-1 to city-3, as indicated by the third row of this range. The per
unit shipping cost per unit distance is given as 5 monetary units. The distances between the five
warehouses and the four cities are also given. For example, the distance between warehouse-2 and
city-3 is 17 distance units. With this data compute the cost of shipping the various quantities given
above between the warehouses and the cities.

Now, suppose rows and columns of the distance matrix are labeled with names of their respective
warehouses and cities; similarly, in the shipping plan, instead of warehouse and city numbers, the
corresponding names are given. In this case, in each transaction, you need to convert the warehouse
and city names to the row and column numbers in which their costs occur in matrix.

Q8) You have been given the Student Computing Survey Data (Student ID, DoB and Age). Prepare
a frequency table to find the number of students in the age group less than or equal to 22, >22 -
<=31, >31 - <=40, >40 - <=60 and >60 - <=80.

Q9) Use the analysis Toolpak to draw a histogram for age from above dataset.

ITM (Page - 13)


Q10) Find the correlation between Maths and English Scores.

Q11) Suppose you want to determine whether a person's salary is a function of his or her education
level (measured in years). Interpret the result.

Practice Exercise 1
Example 1 - Weekly Wages Computation - Suppose you are given the following data related to a
week on each employee of a company:

Basic Wage Hrs


EmpCode (Rs/hr) Worked No of Pcs Produced
E1 20 40 440
E2 25 48 530
E3 25 56 490
E4 20 32 350
E5 30 40 350

Further, the following data that applies to all employees is also given:

i. Standard rate of production is 10 pieces per hour


ii. Extra pay (or, incentive pay) for each piece produced over and above the standard
production, is 5 Rupees per piece

Design a spreadsheet to contain the above data, and to compute using this data the following:

i. For each employee, the regular pay for the week


ii. For each employee, the incentive wage, if any, for the week
iii. For each employee, the total pay for the week
iv. For all the employees put together, the sum of regular, incentive, and total pay
v. The sum of incentive pay as a percentage of the sum of total pay.

Example 2 - Personal Database – You are asked to use the given staff data to selectively retrieve
and extract a part of the information as given below.

i. All female employees with experience of 8 years


ii. All female employees with experience greater than 5 years
iii. All employees with specific name Rama
iv. Find the average salary of all female employees

ITM (Page - 14)


v. Find the total number of employees in the dataset with age more than 30 years

Example 3 - Sales Revenue Query: Handling Complex Queries - The following table shows
the maximum and minimum daily sales revenue earned by a company in 10 cities, considering
the sales in the month of June.

A B C D
1 Sales Revenue per day during June
2 (Rs 000)
3 City Max Min
4 A 90 30
5 B 40 40
6 C 60 50
7 D 85 20
8 E 40 20
9 F 35 30
10 G 85 5
11 H 75 48
12 J 55 45
13 K 64 60

i. How many cities are there whose maximum sales revenue was greater than Rs 50000
OR the average sales revenue (take the average as equal to half of the sum of
maximum and minimum revenues) was greater than Rs 35000?
ii. How many cities are there whose maximum sales revenue was greater than Rs 80000
AND minimum was less than Rs 10000?

Example 4 – Promotion Policy - A teacher in a university is eligible for promotion to professor


only if she/he has published at least five papers in A grade international journals. Publications in
national journals and publications in B grade international journals are also counted for this
purpose, but only after converting them to equivalent number of Grade A international
publications. In the counting process, twenty national publications are treated equal to one A-
grade international publication; and five B-grade international publications as equivalent to one
A-grade international publication. If the total number of papers published (counting all
categories as equal) by a candidate is more than 20, she/he becomes eligible for a cash reward.

You have been provided with the sample data for ten candidates. Please calculate the total
number of candidates eligible for promotion and total number eligible for cash award.

ITM (Page - 15)


Number of
Name of the National Number of A-grade Number of B-grade
Candidate papers international papers international papers
ABC 10 1 5
XYZ 15 0 0
BBV 8 2 1
ABF 15 3 10
FFK 30 4 2
GGF 10 1 1
MOP 5 3 15
CCR 30 4 0
RCC 25 1 10
BBB 12 2 3

Example 5 - XYZ Store pays a 8 percent bonus on sales over $5,000 to store managers. You
have received the quarterly sales data and are required to determine the bonus on sales above
$5000.

Example 6 - If I ordered 500 units of a product I pay $3 per unit. If I order between 501 and
1200, I pay $2.70 per unit. If I order between 1201 and 2000, I pay $2.30 per unit. If I order
more than $2000, I pay $2.00 per unit. Write a formula that calculates the purchase cost as a
function of number of units purchased?

Example 7 - In a dice game two dice are tossed. If the total on the dice on the first roll is 2, 3, or
12, you lose. If the total is of the dice on the first role is 7 or 11, you win. Otherwise, the game
keeps going. How can I write a formula to determine the status of game after first roll?

Example 8 - The following problem refers to the data for Jan sales and Feb. sales. Each sheet
contains the unit sales, dollar revenues, and product sold for each transaction during the month.
Create a consolidated worksheet that gives by region the total unit sales and dollar revenue for
each product. Also create a consolidated sheet that gives by region the largest transactions for each
product from the standpoint of revenues and units sold.

Example 9 - Suppose the price of a product will change at dates in the future as follows:

Date Price
On or before Feb 15, 2004 8
Feb 16, 2004 to on or before April 10, 2005 9
April 11, 2005 to on or before January 15, 2006 10
January 16, 2006 onwards 12

ITM (Page - 16)


Write an IF formula that computes the price of the product based on the date product is sold.

Example 10 - You have been given the employee ID Codes, Salaries and Years of Experience.
Write a Formula that takes given ID code and yields the employee salary. Write another formula
that takes the given ID code and yields the employee’s years of experience (use lookup function).

Example 11 - You are thinking of advertising Microsoft products on a popular TV music program.
You pay one price for one group of ads, but as you buy more ads, the price per ad drops as described
in the following table. Write a formula (use lookup function) that yields the total cost of purchasing
any number of ads.

Number of Ads Price per Ad


1-5 12000
6-10 11000
11-20 10000
More than 20 9000

Example 12 - In the previous problem suppose, if you buy more ads, the price is determined as
follows. If you buy 8 ads, you pay 12000 for first 5 ads and 11000 for next 3 ads. Similarly if you
buy 14 ads, you pay 12000 for first 5 ads, 11000 for next 5 ads and 10000 for remaining 4 ads.
Write a formula (using lookup function) that yields the total cost of purchasing any number of ads.

Example 13 - The distance between any two cities can be approximated using the formula 69 *
sqrt ((difference in latitude) ^ 2 + (difference in longitude) ^2)). The latitude and longitude
data of select cities is given to you. Using lookup function create a table that gives the distance
between any two cities.

Example 14 - You have been given the customer code (CCODE), Customer type (CTYPE),
product purchased (PCODE), quantity purchased (QTY), and the total monetary value
(AMOUNT) of the sale for six sales transactions (The values in AMOUNT field are concealed
from you). The AMOUNT is computed as quantity multiplied by unit price after applying an
appropriate discount; unit price is Rs 10 for all products; however, the percentage discount, D1 or
D2, depends on whether CTYPE is 1 or 2 respectively. The values of D1 and D2 for each of the
products are given. The AMOUNT is computed through a formula for the first transaction; the
formula is copied to subsequent cells. What is the formula in Amount Cell?

Example 15 - Let’s say we monitor quality of a plant producing glass bulbs. One of the KPIs we
monitor is % of rejected bulbs. We have been tracking the % of rejects by day in a spreadsheet
given to you. Calculate the average rejects of latest week? Please note that the data for % rejects
will keep on building with time.

ITM (Page - 17)


Managing Marketing Data & its Applications
(Session 5-6)
Reference: Chapter 5 & 7 of Textbook
1) Data Sorting: It is found in the Data menu. In earlier versions of excel it was difficult to sort
more than three criteria. For example, if you were required to sort by more than three criteria, you
had to do this with two sorts. To sort by Name, then by Date, then by Product, then by Units, then
by descending Location, you would first sort by Units and Length. Then, do a second sort by
Name, Date and Product.

2) Data Subsets or Filtering of Data: There are two ways of Filtering – AutoFilter and Advanced
Filter.

3) Subtotals: Summarize a list within a list.

4) Pivot Tables: A very powerful tool in excel which helps to summarize data contained in
columns by means of subtotals or other calculations. The default summary is a sum. The other
calculations might be average, count, max, min, percentages, standard deviation etc.

Reasons for organizing data using pivot table:


- Summarize lengthy list into compact form
- Find relationship between data that is hard to find otherwise
- Convert data into easy to understand charts.
- Include or exclude variables easily.

What’s required to create a Pivot Table:

Row/Column Field: Row/column variables that control the data to be summarized


Data Field: Variable that you want to summarize.
Page Field: Page field operates like the row and column fields but provides a third dimension to
your data.

Determining Pivot Table Layout – Discrete vs. Continuous variables

Discrete variable: This generally takes small number of unique values. Eg. Dept. Name, Customer
Names, Product etc. These variables are best suited for row/column fields, although they can be
used as data fields.

ITM (Page - 18)


Continuous variable: This generally takes a large number of values. Eg. Units Sold, Revenues,
Profitability etc. These are best suited as data fields. Its generally not a good idea to use a
continuous variable as a row/column field.

When you define a pivot table you must identify the row/column and data fields. One can also
define subsidiary or inner rows/columns. A Pivot Table isn’t directly linked to the source data. If
you change the source data, you need to refresh using the red exclamation mark on toolbar to
update the pivot table.
Exercise 2
Natural Skin Care Company that deals in beauty products manages its sales transaction data on
Excel. Being a Sales Manager of Natural Skin Care you are responsible for monitoring and
managing sales activities of the company across Cities and Regions. As a Sales Manager you need
to look at the sales transaction data at disaggregated level, at aggregated level, generate summary
reports, MIS reports and may also needs to analyze the trends and take decisions. While taking
decisions, Sales Manager wants flexibility in terms of generation of summary reports, extracting a
set of data, changing the decision criteria every minute and see an impact on the output. The Sales
Manager also wants to perform the multi-dimensional analysis on the sales data to find hidden
patterns, for example, which product is in more demand in which location of which city?

1. Organize the Sales data in Ascending order of Units Sold to find the lowest sales
transaction. Is there a better method to find that?
2. Organize the sales data on Name and Product
3. Sales Manager wants to review the performance of “Charu”, so highlight all the
transactions done by Charu in Red color
4. Highlight records where units <50 in red color and otherwise in blue color.
5. Organize the data first by red and then by blue color.
6. Select those records highlighted in blue color.
7. Generate the following Transaction Reports for the Sales Representative indicating total
units sold and total revenue:
o Salesperson wise sales report
o Product wise sales reports
o City wise sales reports
o Salesperson wise, product wise, city wise sales report
8. On the previously generated Salesperson wise, product wise, city wise sales transaction
report also add the average sales revenue and the number of sales transactions done by
each sales person.
9. Generate the MIS report to show only the salesperson wise, product wise sum of sales
revenue and average of sales revenue.
10. Drill the sales transaction data for “mascara” sold by “Eshita”.

ITM (Page - 19)


11. Find the Total revenue and units sold by Region.
12. Units sold and revenue for each salesperson
13. Number of sales transactions involving each product.
14. Largest (transaction in terms of revenue) for each product
15. Average amount per transaction by region.
16. The number of sales transaction for each salesperson.
17. For each salesperson, the total revenue by product.
18. Total revenue generated by each salesperson broken down by location.
19. Total revenue by salesperson and year.
20. Select all transactions from South where the sales units are greater than 17
21. List all transactions of 2004 sold by Zara and where Revenue is more than 50
22. List all transactions in which Jagriti sold lip gloss
23. List the Ten largest transactions by revenue
24. List the Bottom 5% of transactions by revenue in which Chhaya was the Salesperson.
25. List all 2005 lipstick transactions in which Aishwarya was the salesperson.
26. List all transactions of foundation in first six months of 2005 in which Eshita or Jagriti
was the salesperson and per unit price was more than 3.20.
27. Find all transactions in which Harshita sold eye liner in the West and city Delhi or
Mumbai.
28. Find all transactions in top 5% with regards to units sold
29. Find top 20 revenue generating transactions that involved foundation sales
30. Find all transactions involving sales of at least 60 units during 2004 for which the per unit
price is at least 3.10
31. Find all foundation transactions during the first three months of 2004 for which the unit
price was large than 3.05
32. List all transactions in which Zara or Bhumika sold lipstick or foundation in Delhi or
Jaipur.
33. List all transactions for lipstick sales by Jagriti during 2005 or foundation sales by Zara
during 2004 in Pune.
34. Extract only the Names of salesperson
35. Extract unique combination of salesperson, product and region for sales revenue > 200
36. Create a summary report of salesperson wise sales using Pivot
37. Create a summary report of salesperson wise and product wise sales
38. Find the salesperson wise contribution to total sales
39. Find the salesperson wise contribution (in %age) to product level and total sales
40. Find the product wise sum of revenue and identify which product has the lowest sales.
41. Drill the summary data for “Lipstick”.
42. Slice the Product wise sales data to restrict the output
o for “Bangalore”
o for “Delhi” and “Bangalore”
43. Drill the output to show all location-wise sales only for “lip gloss”

ITM (Page - 20)


44. Remove the Drill-down
45. Dice the output to restrict it to show quarter wise and year wise
46. Show the report in a graphical format
47. Calculate the unit price for each of the products and identify which product is cheapest
and which is most expensive.
48. Identify the city for which “Eye Liner” has the least demand.
49. Identify the city and Region for which “Lip Gloss” is in more demand.
50. Identify the sales pattern as per Region and City.

ITM (Page - 21)


Practice Exercise 2
Example 1 - You have been given annual sales for different products and regions. Can you find
any patterns in the data? What are the regional sales? Find the regional sales for each product?
Which variables define the inner row field and outer row field?

Example 2 - Annual sales of different manufacturers are available to you. Identify the discrete and
continuous variables? Find the sum of annual sales for various manufacturers, years and both.

Example 3 - You have a small travel agency. And you’re about to do a mass mailing of a travel
brochure. Your funds are limited, so you want to mail the brochure to people who spend the most
on travel. For a random sample of 925 people, you have the gender, age and amount spent on travel
last year. How can you use this data to determine the following:-
a) Determine how gender and age influence persons travel expenditure
b) Average amount spend on travel by gender.
c) Average amount spent on travel for each age group
d) Average amount spent on travel by gender for each age group
What recommendations can you make about the type of person to whom you should mail
the brochure?

Example 4 - Suppose that you are doing market research about Station Wagons. Your goal is to
find what factors influence the likelihood that a family will purchase a station wagon. For a large
sample of families, you’re given the family size (large or small) and the family income (high or
low). Can you determine how family size and salary influence the likelihood that a family
purchases the station wagon? Here you need to look at how salary affects purchase decision for
each family size and how family size affects purchase decision for each salary level.

Example 5 – Use the Sales Data of ABC Inc. to analyze sales trends as per the following
requirements. The data is available in Example 5 sheet.

1. Arrange all sales transactions salesman-wise in a particular order.


2. Find the total sales done by “Ajay”.
3. Find the number of transactions done by “Ajay”.
4. Find the total sales done by each salesman.
5. Find the average sales done by each salesman.
6. Find the product-wise total sales done by each salesman.
7. Find the product-wise and area-wise total sales done by each salesman.
8. Find which salesman should concentrate on which product and which area.
9. Create salesman vs product cross-table on average sales

ITM (Page - 22)


10. Find how the sales transactions (in terms of sales) are distributed as per following
ranges:

Upto 3000
3001 to 5000
5001 to 7000
7001 to 9000
9001 to 12000
12001 and above

Draw the histogram for the above distribution.

11. For the above distribution also find the cumulative frequency.
12. List the salesmen who are doing sales transactions more than 7500.
13. List the salesmen who are doing sales transactions more than 7500 for product P3.
14. List the salesmen who are doing sales transactions more than 7500 for product P3 in
area A02.
15. List the transactions of all salesmen whose name starts with alphabet A.
16. List the salesmen who are doing sales between 7000 and 9500.
17. List the salesmen who are doing sales between 5000 and 8500 in area A02.
18. Extract the only the name of the salesmen whose sales is more than 8000.
19. Extract the name and the area of all those transactions where a sale is between 5000
and 7500.
20. Extract the unique transactions for salesman “Ashok”.

Example 6: Use the ABC Sales data in Example 6 sheet for organizing and summarizing the
sales data

1. Filter the data based on following criteria:


a. Authorized Person names ending with “K”.
b. Authorized person names not ending with “N”.
c. Amount is Between 100 and 500.
d. Amount is Less than 100 or greater than 700.
2. Filter the Data Based on Amount >500.
3. Filter the Data which is ordered between dates 9/5/2005 – 10/5/2005.
4. Identify all transactions performed by Kiran for IT department.
5. Identify all transactions performed by either Sumit or Priya for Consulting or Equipment
category in IT or HR department.
6. Identify top 10 transactions where category is either Services or Software.
7. Generate a list of Authorized persons.
8. Identify all those transactions where department is either HR or Production and sales Amount
is greater than average of total sales amount.
9. Sort the data on the following bases :
a. Amount
b. Department and then Category
c. Department -> Category -> Authorized Person

ITM (Page - 23)


10. Perform Subtotal on the basis of Amount spend for each Department.
11. Enter the following validation for Amount column:
a. It should accept only whole numbers.
b. It should not accept value less than 10 or greater than 8000.
c. It should display input message regarding validation criteria.
d. It should display an error message” Wrong Entry” if user is entering invalid data.

Example 7:

1. Create a copy of sales data in new sheet and name it as “Pivot Table Report”.
2. Create a pivot table displaying the number of products sold for each quarter region wise.
3. Create a Pivot table report for displaying the number of products sold by each employee
region wise.
4. Create a pivot Table report for displaying the total cost of sales of individual item region
wise.
5. Create a pivot table displaying the min, max and average quantity sold for each item
region wise.
6. Create a pivot table displaying the top six employees based on the total cost of sales
done.
7. Create a pivot table displaying the monthly sales of year 2003 and 2004 for TV and
DVD.
8. Create a pivot table displaying the quantity sold for each item region wise and add one
column which will calculate the % of quantity sold for the product to the total for that
region.
9. Create a pivot chart displaying the total quantity of all products sold for year 2003 for all
regions.
10. Create pivot chart displaying region wise sales made by each employee for all products.

ITM (Page - 24)


Managing Financial Data & its Applications
Sensitivity Analysis using Excel
(Session 7-8-9-10)

Reference: Chapter 6, 8 & 10 of the Textbook

1) Financial Function: Excel provides a range of function to perform financial related operations.

Present Value (PV) – returns the present value of an investment based on an interest rate and
constant payment schedule.

Future Value (FV) – returns the future value of an investment based on an interest rate and a
constant schedule.

PMT: returns the payment amount for a loan based on an interest rate and a constant payment
schedule.

PPMT: returns the principal payment for an investment based on an interest rate and a constant
payment schedule.

IPMT: returns the interest payment for an investment based on an interest rate and a constant
payment schedule.

Net Present Value (NPV): returns the net present value of an investment.

Internal Rate of Return (IRR): returns the internal rate of return for a series of cash flows. It’s
the rate of return which makes NPV of a project equal to zero.

Rate Function: returns the periodic interest rate of a loan, given the number of payment periods,
periodic payment amount and the loan amount. For eg. The annual interest for a 48 month loan for
5000 that has a monthly payment amount of 117.43 is given by the function as =Rate(48,
117.43,5000)*12

NPer Function: returns the number of payment periods for a loan, given the loan amount, interest
rate and periodic payment amount. For eg. The number of payment period for a 5000 loan that has
a monthly payment amount of 117.43 at 6% rate of interest is given by the function =
Nper(0.06/12,117.43,5000)

ITM (Page - 25)


2) Goal Seek: Goal Seek enables you to compute a desired value in a cell computed using a
formula by changing an input cell. To use goal seek three pieces of information is required:

Set Cell: Containing the formula.


To value: The numerical value you desire for the set cell.
By changing cell: Input cell that excel changes until the set cell calculates the desired value in to
value cell.

2) What if Analysis using Data Table: Data Table is a frequently used tool in excel to track how
small changes in inputs affect the results of formulas that are dependent on the input values. For
e.g. one might be interested in knowing how the price change for a product affect the firm’s net
income. This type of analysis is known as what if analysis or sensitivity analysis. Excel has two
types of Data Table.

The One-Variable Data Table: allows identification of a single input variable on any number of
formulas

The Two-Variable Data Table: allows identification of two variables on a single formula.

4) Sensitivity Analysis using Scenarios: Sensitivity analysis using Data table is useful if you
want to see the impact of changes in a maximum of two variables. If you want to see the impact
of changes in more than two input variables, scenarios are used.

5) Naming Ranges: Named Ranges are a powerful tool in Excel that allows you to assign a
meaningful name to a single cell or a range of cells. The range of cells can be located anywhere in
the workbook. They can be adjacent cells or nonadjacent cells. When a range of cells that has a
name is selected, the range name appears in the name box. Each range must have a unique name—
the same name cannot be used to reference more than one range in a workbook.

For example, you can assign the name "TaxRate" to cell C1 and then use the name "TaxRate"
anytime you would normally use the cell C1, such as =A5*TaxRate.

You can name ranges by any one of the methods:


- By Typing in Name Box
- Using Create Command
- Using Define Command

ITM (Page - 26)


Exercise 3
1. You want a housing loan for construction of a house. Estimated construction cost is Rs.
20 lakhs. You can contribute Rs. 4 lakhs from your own savings and remaining you
need to get it financed from a bank @ 8% per annum for 10 years.

2. The monthly installment as per the above conditions is not suitable and does not fit in
your budget. The maximum what you can pay is Rs. 18000 per month. You are ready
to increase the payment period. Find the payment period that fits your budget (assuming
all conditions remain same).

3. But in reality, finance companies offer different conditions for different situations. You
want to evaluate multiple options as per following conditions:
Company Rate Period
ABC Finance 9.0% 5 years
ABC Finance 8.75% 7 years
ABC Finance 8.25% 10 years
Sun Finance 9.1% 56 months
Sun Finance 8.7% 80 months

Do the what-if analysis to find the best possible option.

4. Once you finalise the finance plan for a particular period, find how the monthly
installment is going to be adjusted to the loan amount (principal and interest part). Also
calculate the total interest to be paid at the end of the period.

5. How much you save every month to get a maturity amount of Rs. 5 lakh at the end of
5 years at 7% per annum.

6. Suppose you wanted to save Rs.500,000 before you retire in 10 years. You can earn
4% interest in an annuity product but you want to know given that interest rate how
much money you need to put aside monthly to reach your savings goal.

7. How much you save every month to get a maturity amount of Rs. 5 lakh at the end of
5 years at 7% per annum.

8. You invest Rs. 10,000 per month at an annual interest rate of 8%. Over a fixed period
of x months you want a return of Rs. 500,000. Find the period needed for an investment
to grow from Rs. 10,000 to Rs. 500,000.

9. If you invest Rs. 8000 today with a financial company and the company pays you Rs.
1000 in the 1st year, Rs. 1500 in the second year, Rs. 2000 in the 3rd year, Rs. 2500 in
the 4th year and Rs. 3000 in the 5th year at 5% rate. Is this a good investment?

ITM (Page - 27)


10. For a payment of Rs. 10000, a finance company will pay back Rs. 3000 at the end of
next four years. Whereas, bank offers 5% interest rate in its saving bank account. Find
out where one should invest?

11. Two investment options are available to you. In 1st option, on Rs. 1000, of investment,
you will get Rs. 450 at the end of the 1st year, Rs. 325 at the end of 2nd year, Rs. 400 at
the end of 3rd year and Rs. 300 at the end of 4th year. Whereas, in the 2nd option, on Rs.
700 of investment, you will get Rs. 250, Rs. 300, Rs. 500 and Rs. 200 at the end of 1 st,
2nd, 3rd and 4th year respectively. Evaluate which scheme offer better returns.

12. Suppose you invest Rs. 400,000 in a fund. The return which you get in the first five
years is : Rs. 92000, Rs. 85000, Rs. 94000, Rs. 92500 and Rs. 90000. Find the rate of
return at the end of two years, four years and five years.

13. On the 10th birthday of Joy, his parents decided to invest Rs. 4000 every year till the
17th birthday. Return available on this investment is 8% per year. From 18th birthday
onwards to 21st birthday they want to withdraw Rs. 20000 every year for Joy’s
education. You need to find whether Rs. 4000 investment every year was sufficient to
meet these Joy’s education expenses after 18th birthday. If it is not, find how much
they should have invested every year?

14. Refer to the Sheet 3 Session-3 workbook to do scenario analysis. Change the values of
revenue earned thru consultancy and revenue from sales and the see the effect on the
operating income. Change the values in the consultancy and travel heads under revenue
and also change the value of salary, rent and utilities and see the effect on the operating
income. Compare the two scenarios to take optimal decision.

15. Should a pay 11000 today for a photocopier or 3000 a year for 5 years? Assume the
cost of capital is 12% per year.

16. If I invest 2000 a year for 40 years towards my retirement and earn 8% a year on my
investments, how much will I have when I retire?

17. I am borrowing 10,000 on a 10-month loan with an annual interest rate of 8 percent.
What will my monthly payments be? How much principle & interest am I paying each
month? What is total interest I am paying?

18. You have been given the cash flows for Project 1 & 2. Find out the NPV at r=0.2 and
r=0.01. Determine the IRR for the two projects.

19. You have been given the annual fixed cost (45000) and variable cost (4500) for running
a lemonade store. The price for a glass of lemonade is 3. The demand for lemonade is
estimated at 10000 glasses at a unit cost of 0.45. How many glasses of lemonade need
to be sold per year in order to break even?

20. You are going to buy a new house. The amount of money needed (with a 10 year
repayment period) is 1000,000. The annual interest rate is 8%. Calculate monthly

ITM (Page - 28)


payment for various interest rates. Calculate what would be the monthly payment for
different repayment period. Calculate monthly payments for different combinations of
interest rates and payment period.

21. Consider the following cash flows:


15th Dec. 2009 (5000)
th
18 Jan. 2010 1300
17th April 2011 2600
th
25 July, 2012 2877
If today is November 15, 2009, and rate is 12%, what is the NPV of these cash flows?

22. Find all IRRs for a project having the given cash flows on the listed dates:

10/11/09 10/5/10 25/2/10 18/2/11 20/8/11 1/2/12 10/10/12


-1000 900 800 700 500 500 350

ITM (Page - 29)


Practice Exercise 3
Example 1: You are thinking about starting a pension fund. You plan to deposit 2000 in the fund
at the beginning of each year and you expect the average rate of return to be 9% per year for the
entire term. Assuming you are now 30 years old, how much money will your account accumulate
by the time you are 65?
Now assume that you started the pension fund 3 years earlier and have already accumulated 7500
in your account. How much money will your account accumulate at the end of the 35 years.

Example 2: You are presented with an investment opportunity that returns 1000 each year over
the next five years. To receive this annuity, you must invest 4000. Are you willing to pay 4000
today to earn 5000 over the next five years? The rate of interest is 4.5%.
If you are offered a lump sum of 5000 at the end on the 5 year period instead of each year, would
the investment still be attractive?

Example 3: You have been asked to organize a conference. The fixed costs are 15000, and you
need to pay the college union 300 per participant as food and lodging cost. You have invited 10
speakers and they need to be paid 700 per head. You are charging 900 per participant who is not a
speaker as conference fee including food and lodging. How many paid registration are needed for
you to break even?

Example 4: We want to pay off the mortgage in 15 years. The annual rate of interest is 6 percent.
The bank has told us we can afford monthly payments of 2000 only. How much can we borrow?

Example 5: The monthly income statement for ABC Co. is given to you for analysis. Total
revenue, total expenses (fixed + variable) and total operating income has been calculated in
different cells. You have been asked to show the effect on Revenue, Expenses and Income if units
sold varies from 800 to 1500 by 100.

Example 6: XerTech Copy Inc. is running a photocopying business and has leased 40 photocopy
machines for its use. The average monthly expense details for each machine is given. The monthly
net income is calculated for you. You want to maximize the net income and wonder how copy
volumes affect Net Income. You change the copy volume figure from 30,000 to 45,000 and the
Net Income changes to $16,600. But what if you want to see the effect on Net Income for many
different values for Copy/Month/Copier volume (say from 24,000 to 44,000 in multiples of 2000)

You observe that the values for Revenue, Cost of Goods Sold, Contribution Margin, and General
and Admin. Costs change each time you change the value for copy volumes. Can you track how
sensitive each one of these values is to copy volume?

ITM (Page - 30)


There are some key value combinations you particularly want to highlight to the management? In
case where Copies/Month/Copier is 30,000, the scenario is expected demand. For copy volumes
equal to 5000, the scenario is low demand and 50000 is very high demand.

Now you want to track the effect of both copy volume and price charged per copy on Net Income.
Take price charged per copy in multiples of 0.05.

Example 7:

a) Your business has a modest sale of Rs.25,000. You've set yourself a new sales goal of
Rs.35,000. At the moment, you're selling 1000 items at 25 each. Assume that you'll still sell
1000 items. To achieve new sales figure of Rs.35,000, by how much do you have to raise your
prices?
b) You've had a meeting with your staff, and it has been decide that a price change from 25 to 35
is not a good idea. A better idea is to sell more items. You still want a sale of Rs.35 000. Use
Goal Seek to find out how many items you'll have to sell to meet your new profit figure.

Example 8:

Suppose you’re a sales representative for a packaging business. You must achieve Rs.1,00,000 in
sales this year to receive a bonus. Till date you have sold 2,000 units of a product with a per-unit
sales price of Rs.3.46. How many units must you sell to achieve your Rs.1,00,000 goal?

Example 9:

a ) You are planning to apply for loan .Suppose you know the loan amount, interest rate, and
number of periods in years. They are as follows:
Loan Amount = 30,000
Interest Rate (annual) = 10%
Number of years = 5
Monthly payment =?
Given this data you want to know the monthly payment at several interest rates varying
between 6% and 9%.

b ) Using the data given in part (a), calculate monthly payment for several different combinations
of total mortgage periods (3 years – 6 years) and interest rate (6% - 9 %).

Example 10:

Suppose you borrow 400000 on a 20 year car mortgage and the interest rate is 0.5% per month.
Create a table that shows for amounts borrowed between 300,000 and 600,000(in 50,000
increments) the difference in payments between a 15 year, 20 year, and 30 year mortgage.

ITM (Page - 31)


Example 11:

In mortgage problem, suppose you need to borrow 200000 for 15 years. If your maximum
payments are limited to 2000 per month, how high an annual interest rate can you tolerate?

Example 12:

For mortgage problem use scenario manager to create a report tabulating monthly payments for
the following scenario:

Amount Annual Number of Monthly


Scenario Borrowed rate Payments
Lowest Payment 300000 4% 360
Most Likely Payment 400000 6% 240
Highest Payment 550000 8% 180

ITM (Page - 32)


Managing Operations Data & its Applications
(Session 11-12)
Reference: Chapter 9 of Textbook
Linear Programming and Optimization with Solver: Linear Programming (LP) is one of the
most popular Operations Research technique for solving allocation problems and has become a
standard for businesses and organizations. For eg. What should be the product mix in a
manufacturing plant that maximizes profit or what kind of product mix minimizes the cost?

Note: To solve LP problems the Solver add-in must be included.

Exercise – 4
1. ATV company produces two types of TV sets, the Astro and the Cosmo. There are two
production lines, one for each set, and there are two departments, both of which are used
in the production of each set. The capacity of the Astro production line is 70 TV sets per
day. The capacity of the Cosmo line is 50 TV sets per day. In department A picture tubes
are produced. In this department the Astro set requires 1 labour hour and the Cosmo set
requires 2 labor hours. Presently in department A maximum of 120 labor hours per day can
be assigned to production of the two types of sets. In department B the chassis is
constructed. In this department the Astro set requires 1 labor hour and the Cosmo also
requires 1 labor hour. Presently, in department B a maximum of 90 labor hours per day
can be assigned to production of the two types of sets. The profit contributions are 20 and
10 dollars, respectively, for each Astro and Cosmo set. Maximize the profit by optimally
utilizing the resources.

Astro and Cosmo Data


Daily Labor Utilization Profit per
Capacity Per set (HR) set (s)
Dept.A Dept.B
Astro 70 1 1 20
Cosmo 50 2 1 10
Total Availability 120 90

2. The Acme Company manufactures two products – widgets and gadgets. The company
earns a profit of Rs.2 per box for widgets and Rs.3 a box for gadgets. Each product is
assembled and packaged. It takes 9 minutes to assemble a box of widgets and 15 minutes
for a box of gadgets. The packaging department can package a box of widgets in 11
minutes, while a box of gadgets takes 5 minutes. Acme wants to find out what combination

ITM (Page - 33)


of boxes of widgets and gadgets will maximize total profit, given that there is a maximum
of 1800 hours available in both the assembly and packaging departments.

3. A personnel manager must schedule the security force in such a way as to satisfy the
staffing requirements shown in Table
Security Staffing Requirements
Time Minimum Number of
Officers Required
Midnight – 4 A.M 5
4 A.M – 8 A.M 7
8 A.M - Noon 15
Noon - 4 P.M 7
4 P.M - 8 P.M 12
8 P.M - Midnight 9

Officers work 8-hours shifts. There are 6 such shifts each day. The starting and ending
times for each shift are given in Table
Security Staffing Requirements
Shift Starting Time Ending time
1 Midnight 8:00 A.M
2 4:00 A.M Noon
3 8:00 A.M 4:00 P.M
4 Noon 8:00 P.M
5 4:00 P.M Midnight
6 8:00 P.M 4:00 A.M

The personnel manager wants to determine how many officers should work each shift in
order to minimize the total number of officers employed, while still satisfying the staffing
requirements.

4. A grocery store operates seven days a week. A minimum number of employees is required
each day, depending upon the day of the week (as per Table below). The store requires
staff to work five consecutive days, followed by two days off, e.g. an employee working
Monday through Friday gets Saturday and Sunday off. Formulate and solve so as to
minimize the number of employees needed, while meeting the minimum staff requirements
(remember that employee numbers must be integers).

Day Minimum no. of staff


required
Monday 15
Tuesday 13
Wednesday 13
Thursday 15
Friday 19
Saturday 14
Sunday 9

ITM (Page - 34)


5. A Production Problem. Wood Walker owns a small furniture shop. He makes three
different styles of tables: A,B,C. Each table requires a certain amount of time for cutting
component parts, for assembling, and for painting. Wood can sell all the units he makes.
Furthermore, model C may be sold without painting. Wood employs several individuals
who work on a part-time basis, so the time available for each of these activities varies from
month to month. Use the data that follows to formulate an LP model that will help Wood
determine the product mix that will maximize his profit next month.

Model Cutting (HR) Assembling Painting Profit per


(HR) (HR) Table ($)
A 3 4 5 25
B 2 3 5 20
C 4 5 4 50
Unpainted C 4 5 0 30
Capacity 150 200 300
6. Financial Planning. Willie Hanes is president of a one-person investment firm that
manages stock portfolios for a number of clients. A new client has just requested the firm
to manage a $100,000 portfolio. The client would like to restrict the portfolio to a mix of
the three stocks shown in the following table. Formulate an LP to show how may shares
of each stock Willie should purchase to maximize the estimated total annual return.

Stock Price Per Share Estimated Maximum


($) Annual Return Possible
Per Share ($) Investment ($)
Gofer Crude 60 7 60,000
Can Oil 25 3 25,000
Sloth Petroleum 20 3 30,000
7. A Blending Problem. Douglas E.Starr, the manager of Heavenly Hound Kennels, Inc.,
provides lodging for pets. The kennels’ dog food is made by mixing three grain products
to obtain a well-balanced dog diet. The data for the three products are shown in the
following table. If Douglas wants to make sure that each of his dogs consumes at least 8
ounces of protein, 1 ounce of carbohydrate, and no more than 0.5 ounces of fat each day,
how much of each grain product should each dog be fed in order to minimize Douglas’s
cost? (Note: 16 ounces = 1 pound).

Grain Cost Per Protein (%) Carbohydrate Fat (%)


Product Pound ($) (%)
A 0.45 62 5 3
B 0.38 55 10 2
C 0.27 36 20 1
8. A glass manufacturer uses three production plants to assemble its products, mainly glass
doors (x1) and wooden frame windows (x2). Each product requires different times in the
three plants and there are certain restrictions on available production time at each plant.
The maximum production time in three plants is 4, 12 and 18. Plant 1 requires an hour of

ITM (Page - 35)


production time x1, plant 2 requires two hours of production time of x2 and plant three
requires 3 hours of product x1 and 2 hours of x2. The management of the company wishes
to determine what quantities of each product they should be producing in order to maximize
profits. The profit per unit for x1 and x2 is 3 and 5 respectively.

9. A computer manufacturing plant produces mice keyboards and video game joysticks. The
per-unit profit, per-unit labor usage, monthly demand and per-unit machine usage are given
in the following table. Each month, a total of 13,000 labor hours and 3000 hours of machine
time are available. How can the manufacturer maximize its monthly profit contribution
from the plant?

Mice Keyboards Joysticks


Profit/Unit 8 11 9
Labor Usage/Unit 0.2 0.3 0.24
Machine Time/Unit 0.04 0.055 0.04
Monthly Demand 15000 25000 11000

10. Jason the jeweler makes diamond bracelets, necklaces and earrings. He wants to work at
most 160 hours per month. He has 800 ounces of diamonds. The profit, labor time and
ounces of diamonds required to produce each product is given below. If demand for each
product is unlimited, how can Jason maximize this profit?

Unit Profit Labor hours per unit Ounces of diamond per unit
Bracelet 300 0.35 1.2
Necklace 200 0.15 0.75
Earnings 100 0.05 0.5

11. A drug company produces drugs in Los Angeles, Atlanta and New York. The Los Angeles
Plant can produce up to 10000 pounds of drugs per month, Atlanta 12000 pounds per month
and New York 14000 pounds per month. Each month, the company must ship to four
regions of US – East, MidWest, South and West. The number of pounds shipped to four
regions is given in excel file. For e.g. The West region must receive at least 13000 pounds
of drugs each month. The cost per pound of producing a drug at each plant and shipping
the drug to each region is also given in excel. Which is the cheapest way to get each region
the quantity of drugs they need?
12. A company produces two products that are processed on two assembly lines. Assembly
line 1 has 100 available hours, and assembly line 2 has 24 available hours. Each product
requires 10 hours of processing time on line 1, while on line 2 product 1 requires 2 hours
and product 2 requires 3 hours. The profit for product 1 is $6 per unit, and the profit for
product 2 is $4 per unit. Formulate and solve linear programming model for this problem.

13. The Kalo Fertilizer Company makes a fertilizer using two chemicals that provide nitrogen,
phosphate, and potassium. A pound of ingredient 1 contributes 10 ounces of nitrogen and
6 ounces of phosphate, while a pound of ingredient 2 contributes 2 ounces of nitrogen, 6
ounces of phosphate, and 1 ounces of potassium. Ingredient 1 costs $3 per pound, and

ITM (Page - 36)


ingredient 2 costs $5 per pound. The company wants to know house many pounds of each
chemical ingredient to put into a bag of fertilizer to meet minimum requirements of 20
ounces of nitrogen, 36 ounces of phosphate, and 2 ounces of potassium while minimizing
cost. Formulate a linear programming model for this problem and solve.

14. The Pinewood Furniture Company produces chairs and tables from two resources labor
and wood. The company has 80 hours of labor and 36 pounds of wood available each day.
Demand for chairs is limited six per day. Each chair requires 8 hours of labor and 2 pounds
of wood to produces, while a table requires 10 hours of labor and 6 pounds of wood. The
profit derived from each chair is $400 and from each table, $100. The company wants to
determine the number of chairs and tables to produce each day in order to maximize profit.
Formulate and solve linear programming model for this problem

15. A jewelry store makes necklaces and bracelets from gold and platinum. The store has 18
ounces of gold and 20 ounces of platinum. Each necklace requires 3 ounces of gold and 2
ounces of platinum, while each bracelet requires 2 ounces of gold and 4 ounces of platinum.
The demand for bracelets is no more than four. A necklace earns $300 in profit and a
bracelet, $400. The store wants to determine the number of necklaces and bracelets to
make in order to maximize profit. Formulate and solve linear programming model for this
problem.

ITM (Page - 37)


Practice Exercise 4
1. Jason the jeweler makes diamond bracelets, necklaces, and earrings. He wants to work at
most 160 hrs per month. He has 800 ounces of diamonds. The profit, labor time, and ounces
of diamonds required to produce each product are given below. If demand for each product
is unlimited, how can Jason maximize his profit?
Product Unit profit Labor Hours Ounces of Diamonds
per Unit per Unit
Bracelet $300 0.35 1.2
Necklace $200 0.15 0.75
Earrings $100 0.05 0.5

2. The number of telephone reservation operators needed by an airline during each time of
day is as follows:

Time Operator needed


Midnight – 4 A.M. 12
4 A.M. – 8 A.M. 16
8 A.M. – Noon 22
Noon – 4 P.M. 27
4 P.M. – 8 P.M. 31
8 P.M. – Midnight 22

Each operator works one of the following 6 hour shifts: mid-night-6A.M., 6 A.M. – Noon,
Noon – 6 P.M., 6 P.M. – Midnight. What is the minimum number of operators needed?

3. The distance between Boston, Chicago, Dallas, Los Angeles, and Miami are given in the
following table. Each city needs 40,000 kilowatt hours of power, and Chicago, Dallas, and
Miami are capable of producing 70,000 kwh. Assume that shipping 1000 kwh over 100
miles costs $4.00. From where should power be sent to minimize the cost of meeting each
city’s demand?
Boston Chicago Dallas LA Miami
Chicago 983 0 1205 2112 1390
Dallas 1815 1205 0 801 1332
Miami 1539 1390 1332 2757 0

4. We produce drugs at several locations and sell them at several locations. The decision of
where to produce goods for each location can have a huge impact on profitability. We are
using following assumptions:
 We produce drugs at six locations and sell to customers in six different areas.

ITM (Page - 38)


 Tax rate and variable production cost depend on the location where the drug is produced.
For example, any units produced at location 3 cost $6.00 per unit to produce and profits
from these are taxed at 20 percent.
 The sales price of each good depends on the place where the good is sold. For example,
each product sold in location 2 is sold for $40.00.

Production Location 1 2 3 4 5 6
Sales price $45 $40 $38 $36 $39 $34
Tax rate 30% 40% 20% 40% 35% 18%
Variable production cost $8 $7 $6 $9 $7 $7

 Each of our six plants can produce up to 6000000 units per year.
 The annual demand (in millions) for our product in each location is as follows:

Sales Location 1 2 3 4 5 6

Demand 1 2 3 4 5 6

The unit shipping cost depends on the plant where the product is produced and the location where
the product is sold.

Sold 1 Sold 2 Sold 3 Sold 4 Sold 5 Sold 6


Made 1 $3 $4 $5 $6 $7 $8
Made 2 $5 $2 $6 $9 $10 $11
Made 3 $4 $3 $1 $6 $8 $6
Made 4 $5 $5 $7 $2 $5 $5
Made 5 $6 $9 $6 $5 $3 $7
Made 6 $7 $7 $8 $9 $10 $4

For example, if we produce a unit at plant 1 and sell in location 3 it costs $5 to ship it.
How can we maximize after-tax profit with our limited production capacity?

5. A manufacturer produces both motorized and manual trucks. The hand trucks are
assembled in shop 1, and finishing operations are done in shop 2. A motorized truck
requires two hours to assemble and three hours to finish, while a manual truck requires five
hours to assemble and three hours to finish. Shop 1 has 180 hours available for assembly,
and shop 2 has 135 hours available for finishing. The profit for a motorized hand truck is
$200, and the profit for a manual hand truck is $300. The manufacturer wants to determine
the number of each type of hand truck to produce so that profit will be maximized.
Formulate a linear programming model for this problem.

6. A caning company produces two sizes of cans – regular and large. The cans are produced
in 10,000 – can lots. The cans are processed through a stamping operation and a coating
operation. The company has 30 days available for both stamping and coating. A lot of
regular-size cans requires two days to strip and four days to coat, while a lot of large cans
requires four days to strip and two days to coat. A lot of regular-size cans earns $800 profit,
ITM (Page - 39)
and a lot of large-size cans earns $900 profit. In order to fulfill its obligations under a
shipping contract, the company must produce at least 9 lots. The company wants to
determine the number of lots to produce of each size can ( x1 and x2) in order to maximize
profit. Formulate a linear programming model for this problem.

7. A California grower has a 50-acre farm on which to plant strawberries and tomatoes. The
grower has available 300 hours of labor per week and 800 tons of fertilizer, and has
contracted for shipping space for a maximum of 26 acres’ worth of strawberries and 37
acres’ worth of tomatoes. An acre of strawberries requires 10 hours of labor and 8 tons of
fertilizer, while an acre of tomatoes requires 3 hours of labor and 20 tons of fertilizer. The
profit from an acre of strawberries is $400, and the profit from an acre of tomatoes is $300.
The farmer wants to know the number of acres of strawberries and tomatoes to plant in
order to maximize profit. Formulate a linear programming model for this problem.

ITM (Page - 40)


Introduction to PowerPivot
(Session 13-14)
PowerPivot for Excel 2010 is a new data analysis tool aimed at providing unmatched
computational ability in the form of complex analysis of data. This tool is an Excel add-in to
Office 2010 and onwards versions. It's a free download from Microsoft and allows users to work
with extremely large data sets. Before PowerPivot, this kind of analysis was limited to enterprise
Business Intelligence (BI) tools such as SAS and Business Objects.

Before PowerPivot, Pivot Table was the only way to analyze data using excel. With Pivot Table
the greatest limitation was handling data across multiple sheets. It can analyze data coming from
a single sheet or a single table. While working with different excel sheets, there was no simple
way to correlate information using Pivot Tables. Working with limited dataset, Pivot Table
allowed users to work on variables only available within a particular sheet. Further, moving
variables and its associated data from various sheets into one sheet was not always possible.

PowerPivot uses in-memory database and takes advantage of the powerful RAM available in
most computers today. So is PowerPivot an extension of PivotTable? PowerPivot builds on the
existing capabilities of a Pivot Table and provide users with more powerful features and added
functionality. It can be considered a self-service BI tool which is simple to use and helps users
build complex data structures while eliminating the limitations of Pivot Table.

Some of the most useful features of PowerPivot are as follows:


 It allows users to process large data sets (often millions of rows) with about the same
performance as processing a few hundred rows by leveraging the PowerPivot in-memory engine
and its efficient compression algorithms
 It allows users to integrate data from a multitude of sources, including corporate databases,
spreadsheets, reports, text files, and Internet data feeds
 It allows you to output a variety of visual data to your Excel worksheet. You can return data in a
PivotTable, PivotChart, Chart and Table (horizontal and vertical), Two Charts (horizontal and
vertical), Four Charts and a Flattened PivotTable.
 It allows users to use Data Analysis Expression (DAX) to Create Calculated Fields for Slicing and
Dicing Data.
 When combined with SharePoint 2010, it allows users to publish the power of dashboards to
Sharepoint.
 It allows users to import data from external database (SQL, MS Access etc.) by establishing a
connection between the excel sheet and the database.

Building a Dashboard with PowerPivot


Every quarter your team spends countless hours preparing reports for the board meeting. Getting
data from different reports, entering data into Excel, preparing exhibits and checking and
rechecking formulas. After you get the first set of charts ready then you need even more – to
ITM (Page - 41)
explain this quarters variations. So your team spends more hours slicing and dicing the data,
preparing exhibits and checking results.

The following steps are needed to create a Dashboard:

Step 1: Think about the data you want to measure.

Step 2: Connect Excel to the data


PowerPivot has all you need to connect to databases, Excel, Access, text files or sources of data
from the web. Once connected PowerPivot stores a copy of the data in Excel. Millions of rows of
data can be effectively stored by PowerPivot using a new technology that compresses the data.
When you are ready to update the data you just click on the PowerPivot “Refresh” button and an
updated copy of the data in copied into the PowerPivot database.

Step 3: Prepare Excel charts to show the measures

Step 4: Copy the charts to a single worksheet and add slicers - Copy charts from the pivot
table worksheet to your dashboard sheet. Arrange the charts on the dashboard. Then add
“Slicers” which are groups of buttons used so filter the data in your charts. Each slicer can be
attached to multiple pivot tables. When you click on a year in the slicer on the dashboard then
each of the pivot tables attached to that slicer will show data only for that year. In this way slicer
buttons on the dashboard worksheet can control what data is shown on the dashboard charts.

Exercise on PowerPivot
Q1) Use the Staff Database which stores data about its employees (tbl_employees) and the
department (tbl_department) to which they belong.
Explore the database and use PowerPivot to do the following
1. Load the table data from the database in Power Pivot. How many tables are there in field list?
Can you select attributes and values from all the tables?
2. After selecting the two tables, display number of employees in each department
3. Filter the count of records belonging to Department ID 400
4. What is the average starting salary for each department?
5. Display Department name instead of department ID? How do the variables look different from a
Pivot Table?
6. Analyze the relationship between the two tables using PowerPivot.
7. Find the maximum salary drawn by employee with respect to Department and Nationality.

Q2) Building a Dashboard with PowerPivot

First open the PowerPivot Window, connect to the sales database and select the sales order
header and detail tables, the sales territory table and the product, product sub category and
product category tables.

ITM (Page - 42)


Now you connect to the Excel data. First step is to copy the sales budget into the blank
workbook. Make the copied list into a table and create a linked table in PowerPivot. Add the
table in the PowerPivot database.

Find the following:

1. Sum of line total and budget sales by category.


2. Average SalesYTD for each Country and Group. Filter the data on Product Subcategory
3. Create a dashboard to display multiple pivot charts and control by slicers.

Note: PowerPivot for Excel 2010 is available as a free download at www.powerpivot.com.

ITM (Page - 43)


Introduction to Excel Macros
(Session 15-16)
What are macros?
Macros can save you hours by automating simple, repetitive tasks. Marcos in Excel are written in
Excel VBA (Visual Basic for Applications). This is a version of Visual Basic (a prominent
Microsoft programming language) developed specifically for use in Office-like applications.

What is Excel VBA?


Excel Visual Basic for Applications (VBA) is the programming language embedded in Microsoft
Excel that can be used to make sophisticated workbooks or even user-defined applications.

How to check if Visual Basic for Excel installed on your computer?


A quick way to test on either operating system if you have Visual Basic installed is to press
ALT+F11. If the VBA editing window opens, its already installed. Secondly, the macro security
level needs to be set low enough in order for macros to be permitted to run on your computer.

Windows Excel 2007 and later, go to “Developer -> Macro Security” and tick the box of
“Disable all macros with notification”.

Recording a Macro

By recording a simple macro in Excel we will go through the basics of Excel VBA. Here
“recording” means that the actions you take in Excel are translated into written VBA code. Once
it is transformed into code the recorded actions can be repeated as many times as you like by
launching ("running")the recorded macro.

1. Let´s assume we want to record how we copy & paste the value we enter in one cell to many
other cells.
2. Type “Hello” in Cell A1. This will be the cell we will copy & paste to other cells.
3. Go to Developer -> Record Macro”.
4. Enter the macro name as Macro1 and shortcut as ctrl+a
5. Click record macro and copy data in cell A1
6. Select range B4:F10 and paste.
7. Stop recording.
8. Now to test the macro, change the text in cell A1
9. Press ctrl+a and you will find the values in range B4:F10 changing.
10. To see the programming code generated by the recorder we have to go to the VBA editing
window. It can be accessed either by pressing Alt+F11
11. To find our macro double click on the “Modules” folder in the “Project” window. Then double
click “Module1” and the programming code shows.

Macros for Data Formatting

ITM (Page - 44)


Suppose you have been given the Profit data for the period 2001-2009. Record a macro to apply
font color red and size 30 to the title Recording Macros. Make Year and Profit as bold and font
size 16. Change the color of values for Year as Blue and apply conditional formatting on values
for profit. If Profit is negative display with red color. Save the macro as “formatting”

In another sheet apply the macro on the sample data provided for the period 2010 to 2018.

ITM (Page - 45)


Database Application for Effective Data Management
(Session 17-20)

What is a Database?

o An organized collection of data.


o A database management system (DBMS) such as Access, Oracle or SQL Server
provides you with the software tools you need to organize that data in a flexible manner.
o You can add, modify or delete data from the database, ask questions (or queries) about
the data stored in the database and produce reports summarizing selected contents.
o The major components of Access are tables, queries, forms and reports. Tables
comprise the fundamental building blocks of any database.

Create a Table in Design View

Design View will allow you to define the fields in the table before adding any data to the
datasheet. The window is divided into two parts: a top pane for entering the field name, data
type, and an option description of the field, and a bottom pane for specifying field properties.

 Field Name - This is the name of the field and should represent the contents of the field
such as "Name", "Address", "Final Grade", etc. The name can not exceed 64 characters in
length and may include spaces.

ITM (Page - 46)


 Data Type is the type of value that will be entered into the fields.
 Text - The default type, text type allows any combination of letters and numbers
up to a maximum of 255 characters per field record.
 Memo - A text type that stores up to 64,000 characters.
 Number - Any number can be stored.
 Date/Time - A date, time, or combination of both.
 Currency - Monetary values that can be set up to automatically include a dollar
sign ($) and correct decimal and comma positions.
 AutoNumber - When a new record is created, Access will automatically assign a
unique integer to the record in this field. From the General options, select
Increment if the numbers should be assigned in order or random if any random
number should be chosen. Since every record in a datasheet must include at least
one field that distinguishes it from all others, this is a useful data type to use if the
existing data will not produce such values.
 Yes/No - Use this option for True/False, Yes/No, On/Off, or other values that
must be only one of two.
 OLE Object - An OLE (Object Linking and Embedding) object is a sound,
picture, or other object such as a Word document or Excel spreadsheet that is
created in another program. Use this data type to embed an OLE object or link to
the object in the database.
 Hyperlink - A hyperlink will link to an Internet or Intranet site, or another
location in the database. The data consists of up to four parts each separated by
the sign (#): DisplayText#Address#SubAddress#ScreenTip

The Address is the only required part of the string. Examples:


Internet hyperlink example: IMI Home Page#http://www.imi.edu# Database
link example: #c:\My Documents\database.mdb#MyTable

 Description (optional) - Enter a brief description of what the contents of the field are.
 Field Properties - Select any pertinent properties for the field from the bottom pane.

Field Properties

Properties for each field are set from the bottom pane of the Design View window.

 Field Size is used to set the number of characters needed in a text or number field. The
default field size for the text type is 255 characters. If the records in the field will only
have two or three characters, you can change the size of the field to save disk space or
prevent entry errors by limiting the number of characters allowed. Likewise, if the field
will require more characters, enter a number up to 255. The field size is set in exact
characters for Text type, but options are give for numbers:

 Byte - Positive integers between 1 and 255


 Integer - Positive and negative integers between -32,768 and 32,768
 Long Integer (default) - Larger positive and negative integers between -2 billion
and 2 billion.
 Single - Single-precision floating-point number

ITM (Page - 47)


 Double - Double-precision floating-point number
 Decimal - Allows for Precision and Scale property control

Format conforms the data in the field to the same format when it is entered into the datasheet.
The field data formats in Access 2007 have been enhanced to improve the way that tables display
information. You can provide custom formats for each data type in addition to the predefined
formats. Note that the hyperlink, memo and text formats do not have predefined formats.

Relationships and Referential Integrity

Relationships are the foundation of something called relational database design. This is where we
have multiple tables that share some sort of commonality or are in some way alike. We can then
take advantage of this fact by creating tables, queries, forms and reports that interact with other
tables, queries, forms, and reports. This is where databases have the ability to become truly
powerful.

Relationships are made from a link that is created among the primary key in one table to a field
in another table that contains the same structure and type of data. This makes sense because you
wouldn’t want to try and connect the LastName field in one table with the ZipCode field in
another. The types simply wouldn’t match! You would logically want to match the LastName
field with a LastName field in another table. It may be named differently, but it will contain the
same type of data. When a table is connected from a primary key in one table to a foreign key in
another table, then it is considered to have connected a primary key and a foreign key. A foreign
key is a field in the table that is not a primary key, but has the same type of information that
makes the field suitable for a relationship.
There are several types of relationships that can exist in a database. The first of these types is a
one-to-one relationship. This indicates that in either table, the same data item can only appear
once. The second type which is one-to-many relationships occur when each record in Table A
may have many linked records in Table B but each record in Table B may have only one
corresponding record in Table A. The final type is the many-to-many relationship. This is
where the same item can appear multiple times in both tables. It’s been explained as a pair of
one-to-many relationships. Think of an automotive service center. A car can be brought in and
serviced on many dates, which is a one-to-many relationship between the car, and the service
date. However, on one date, many cars can be serviced which is also a one-to-many relationship.

Referential Integrity: If we have created relationships between our tables, they become like
rules to live by. The tables must follow these rules. These rules enable referential integrity. Think
of the automotive shop that we mentioned earlier. Let’s assume that they have a database
designed to track their customers. They also have a separate table in that database that tracks the
cars that they’ve worked on. Each car is related to its owner record in the customer table. This
allows us to track the two items individually, but still allows them to be linked together. Well,
what happens when you delete a customer from the database, but forget to delete his cars? When
a customer is deleted and the cars are not, we violate our referential integrity.

ITM (Page - 48)


Exercise 6
Creating Staff Database, Setting Field Properties
1. Create a new database called Staff.accdb
2. Create a new table in design view. Define the fields listed below. Set an appropriate data
type* for each field and add descriptions where you think this would be helpful. Fields to be
created are as follows:
Name Data Type Description
First_Name
Last_Name
DOB
Job_Title
Telephone
Salary
Nationality
Disability
Notes
Dept_ID

3. Leave the table open in design view


*In particular, note that the Disability Field is to indicate whether the person does or does not
have a disability (no other information will be stored) and the Notes Field is for any additional
information that may be relevant and needs to be of unlimited size.
Modifying design and primary keys
1. Add in an additional field at the beginning called Staff_ID with a data type of Number.
2. Add in another new field after Salary called Start_Date.
3. Set the Staff_ID field as the primary key for the table.
4. Save the table with the name tbl_Employees and switch to datasheet view.
5. Copy and paste all of the records from employees.xls into the tbl_Employees table.

Importing from Excel

1. Import the spreadsheet employees.xls into your staff.mdb database as a new temporary table
with a name of your choice.

ITM (Page - 49)


Field properties

1. Add the following properties to fields in the tbl_Employees table:


Field Property Details
Staff_ID Format 00000
Last_Name Field size 25 characters
DOB Format Medium Date
DOB Caption Date of Birth
Salary Decimal 0
places
Nationality Default British

2. Switch to datasheet view and see how the changes to the properties have affected the table.
3. Return to design view and add the following properties to the tbl_Employees table:
Field Property Details
Last_Name Required Yes
Salary Validation Rule <50000
Salary Validation Text Too much money!

4. Switch to datasheet view and add two new records with details as follows:
Staff_ID 29 30
First_Name Rhys Arnold
Last_Name Schwarzenegger
Job_Title Finance Assistant Chief Executive
Dept_Name Finance
Salary $1,000,000

5. What happens when you try to add the records and why? Do not add the records.

Lookup fields

1. Create a new table called tbl_Ethnicity.


2. Define a single field called Ethnicity.
3. Make this field the Primary Key.
4. Enter the following data in this field: Asian, Black, White, Not provided.
5. Close and save the table.

ITM (Page - 50)


6. Open the tbl_Employees table.
7. Create a new field called Ethnicity.
8. Create a Lookup field for Ethnicity using the Lookup Wizard. Link it to the tbl_Ethnicity
table.
9. Open the tbl_Employees in datasheet view and enter data in the Ethnicity field using (a) the
drop down list; and (b) typing ahead.
10. Close the database.
Preparing to create relationships

1. Import the data from salaries.xls and departments.xls into the database.
2. In the following exercise, you will create the following relationships
Primary table Subsidiary table Common field
tbl_Departments tbl_Employees
tbl_Employees tbl_Salaries

3. For each relationship to be created, ensure that there is a common field in both tables.
4. Ensure that the data types of the common field in each table are compatible.
5. Ensure that the common field in the primary table is designated as the primary key (or at
least has a unique index).

Creating relationships

1. Open up the Relationships Window.


2. Create a relationship between the tbl_Departments table and the tbl_Employees table.
Enforce referential integrity.
3. Create a relationship between the tbl_Employees table and the tbl_Salaries table. Enforce
referential integrity.
Testing referential integrity

1. Open up the tbl_Employees table and add the following new record:
Staff_ID 29
First_Name Stephen
Last_Name Fry
DOB 24/08/1957
Job_Title Customer Services Assistant
Dept_ID 700

ITM (Page - 51)


2. What happens when you try to save the record? Remember that you can use the Esc key on
the keyboard to undo data changes.
3. Open up the tbl_Departments and add the following new record:
Dept_ID 700
Dept_Name Customer Services
Dept_Add1 Office Block
Dept_Add2 Station Road
Dept_Town Swindon

4. Try to add the new record specified in 1 above once again. Were you successful this time?

Access - Using Queries

Database planning and design requires an understanding of how the data is being used or will be
used by end users. It’s important to understand your user needs for information when designing
the database. Asking yourself questions will help in understanding user requirements and can be a
guide to the kind of queries users need.
 What sorts of data comparisons will they want to make?
 What methods of sorting/ordering will they need?
 How will they want results presented?
 What search choices will they need?
In relational database systems, information is stored in different tables. For example, customers'
information is stored in Customers table while their ordering information is stored in Orders
table. In order to retrieve information from one or more than one table, queries are used. Moreover,
queries are capable of performing the functions of filters, namely adding selection criteria and
sorting instructions. In addition, queries allow calculation of new fields. The complexity of your
query will depend on the complexity of the fields that the data is housed in, the functionality of
the database, and the type of information you are trying to gather.
While creating Queries you should specify:
 The table fields that appear in a query.
 The order of the fields in a query.
 Filter and sort criteria for each field in a query.

ITM (Page - 52)


Types of Query
There are different types of queries in access.
Select Query
Select queries are the most commonly used type of query. It allows you to choose which fields and
records to display in a datasheet.
Parameter Query
Using this type of query, you are able to pass a parameter to a different query, such as an action or
a select query. It allows for a dialog box where the end user can enter whatever parameter value
they wish each time the query is run. The parameter query is just a modified select query.
Aggregate Query
A special type of query is known as an aggregate query. It can work on other queries (such as
selection, action or parameter) just like the parameter query does, it creates a summation of any
selected attribute by totals up the items of attribute by selected groups. The aggregate functions
available are Sum, Avg, Min, Max, First, Last, Group By, Count, StDev, Var, Expression, Where.
Action Query
An action query allow for many records to be changed in an existing table (append, delete or
update), or creates a new table. Four kinds of action queries are:

Append Query – takes the set results of a query and "appends" (or adds) them to an existing table.
Delete Query – deletes all records in an underlying table from the set results of a query.
Make Table Query – as the name suggests, it creates a table based on the set results of a query.
Update Query – allows for one or more field in your table to be updated.

Crosstab Query
A crosstab query presents summary information in a compact format that is similar to a
spreadsheet. These types of queries can present a large amount of summary data in a format that
is usually simpler to analyse than viewing the information in a database form. Each attribute (field)
in a table typically contains a category of data. A crosstab query summarizes the data from one or
more of these fields that are separated into groups based on one or more fields.

Calculated Field
A calculated field is based on other fields of the table. It derives its value from some formula
involving other field values.

Eg. Suppose your table contains a column named Sale Amount, and you want to calculate the
amount of commission earned on each sale. If the commissions were always the same, you'd
simply hard code the commission rate as part of the expression. For instance, if the standard
commission were 10 percent, the expression for your calculated field would look like this:

Commission: [Sale Amount]*.1

ITM (Page - 53)


Now let's look at what happens if you pay 10 percent commission for sales below $500, and 15
percent commission for sales of $500 or more. In that case, you will use if function in the
expression you enter for your calculated field. Your expression would look like this:

Commission: IIF ([Sale Amount]<500,[Sale Amount]*.1,[Sale Amount]*.15)


IIF stands for Immediate IF Function

Queries – Adding Criteria


Criteria are the ‘conditions’ put to the query.
Comparison Operators - Exact Match Criteria
One can create an exact match criteria using any one of the comparison operators viz. =, >, <,
>=, <=, < >, between, Is NULL etc.
Conditional/Logical Operators (AND, OR and NOT)
One can use conditional operators to check if the statement is true or false
For example:
<>"FL" Not equal to (all values besides FL)
Between 1 and 10 Numbers between 1 and 10
Is Null Finds records with no value
Is Not Null Finds all records that have a value
>0 And <=10 All numbers greater than 0 and less than 10
"Bob" Or "Jane" Values are Bob or Jane

Wildcards – LIKE condition


The LIKE condition allows you to use wildcards. This allows you to perform pattern matching.
The LIKE condition can be used in any statement like select, insert, update, or delete.

The patterns that you can choose from are:

* allows you to match any string of any length (including zero length)
? allows you to match on a single character
# allows you to match on a single numeric digit

For example:

Like 'b*' would return all values that start with b


Like '*b*' would return all values that contain b
Like '*b' would return all values that end with b
Like 'b?' would return all values that start with b and are 2 characters in length
Like 'b#' would return all values that start with b and are 2 characters in length where the second
character is a number

ITM (Page - 54)


Exercise-7
We will be using the database created in earlier class: Staff.accdb.
Task One: simple select queries

1. Create a query based on the tbl_Employees table.


2. Display the following fields: First_Name, Last_Name, Job_Title, Telephone, Nationality,
Dept_ID.
3. Select all employees who are American.
4. Sort by Last_Name.
5. Save your query with the name Query 1.

Additional tasks:
6. Create a second query based on the tbl_Employees table.
7. Display the following fields in this order: First_Name, Last_Name, Job_Title, Telephone.
8. Select all employees who work in the Sales Department (Dept_ID = 100).
9. Do not display the Dept_ID field in the query results.
10. Sort by Job_Title and then by Last_Name, but do not change the order of the fields.

Task Two: using wildcards

1. Create a query based on the tbl_Employees table. Select all employees whose surnames
begin with the letter “W”. Decide for yourself which fields to display. Save your query with
the name Query 3. How many records are displayed in the query results?
2. Create a query based on the tbl_Employees table. Select all employees with Manager in their
job title. Decide for yourself which fields to display. Save your query with the name Query
4. How many records are displayed in the query results?

Task Three: using AND and OR

1. Create a query based on the tbl_Employees table. Show details for all employees who are
either managers or who work in the Sales Department (Dept_ID = 100). Save your query
with the name Query 5.
2. Create a query based on the tbl_Employees table. Show details for all employees who are
managers in the Sales Department. Save your query with the name Query 6.

ITM (Page - 55)


3. What type of logical operator does each of the above two queries use? Which of the two
queries returns the most records and why?

Additional tasks:
4. Create a query based on the tbl_Employees table. Show details for all employees who are
officers in either the Finance Department (Dept_ID = 300) or the Personnel Department
(Dept_ID = 500). How many records are displayed in the query results? Save your query
with the name Query 7.

Task Four: using date and number criteria

1. Create a query based on the tbl_Employees table. Select all employees who were born before
1950. Decide for yourself which fields to display. Save your query with the name Query 8.
2. Create a second query based on the tbl_Employees table. Select all employees who were
born during the 1960s. Decide for yourself which fields to display. Save your query with the
name Query 9.

Additional tasks:
1. What criterion did you use in step 2 above? How many different ways can you find of
displaying the same results?
3. Create a third query based on the tbl_Employees table. Select all employees who were born
in the month of April. Decide for yourself which fields to display. Save your query with the
name Query 10.
Task Five: null values and excluding data

Create a query which includes all the fields from tbl_Employees. For each of the following
tasks, add criteria to find the appropriate employees, view the results in Datasheet view and then
modify the Criteria rows to carry out the next task.
1. All employees who do have a disability. (Query 11)
2. All employees who do not have a disability. (Query 12)
3. All employees who do not have a telephone number. (Query 13)
4. All employees who do have a telephone number. (Query 14)
5. All employees who are not in the Sales department. (Query 15)
6. All employees who are not managers. (Query 16)

Additional tasks:
7. All employees who are either officers or assistants. (Query 17)
8. All employees who are neither officers nor assistants. (Query 18a and 18b)
Which of the two answers given is correct?
ITM (Page - 56)
Task Six: parameter queries

1. Create a query based on the tbl_Employees and tbl_Departments tables. Display the
following fields: Dept_ID, Dept_Name, First_Name, Last_Name, Job_Title, Telephone,
Dept_Town. Enter a parameter criterion in the Dept_Town field. Save your query with the
name Query 19. Display results for different towns.
2. Create a query based on the tbl_Employees and tbl_Departments tables. Decide for yourself
which fields to display. Enter a parameter criterion in the Dept_Name field. Save your query
with the name Query 20. Display results for different departments.
Additional tasks:
3. Create a query based just on the tbl_Employees table. Decide for yourself which fields to
display. Enter parameter criteria in the DOB field to find employees born between two dates
(you will need two parameters). Save your query with the name Query 21. Display results
for different date ranges.
Task Seven: grouping and aggregate functions

1. Create a query based on the tbl_Employees and tbl_Departments tables. Display the
following fields: Dept_ID, Dept_Name and Staff_ID.
2. Run the query to view the results. Which values are repeated?
3. Add grouping and aggregate functions to the query to enable you to view the number of
employees in each department:
 Add grouping to the fields from tbl_Departments
 Add a Count function to Staff_ID
4. Display the results of the query.
5. Save the query as Query 22.
Task Eight: grouping and aggregate functions

1. Create a query based on tbl_Employees and tbl_Salaries


2. Select appropriate fields and appropriate grouping and aggregate functions to display the
Salary_Date when each employees salary was last increased.
3. Add criteria so that only salaries under £20 000 are displayed.
4. Change the column heading of the Salary_Date field to ‘Last Salary Increase’.
5. Save the query as Query 23.
Task Nine: Calculated Fields

1. Create a query and use a calculated expression to determine Bonus for all existing employees
which is calculated as 10% to the Maximum Salary drawn..
Save the query as Query 24.

ITM (Page - 57)


Database Applications for Creating & Managing IS
Access – Action Queries, Creating Forms & Reports

Action Queries
These are different to Select Queries in that, rather than selecting specific data from tables, they
perform an action on the data in the database and they should therefore be used with caution. The
symbol for each of the Action Queries includes an exclamation mark to indicate that running the
Query might alter the data in your database. Action Queries are created by creating a Query in
Design View and then changing the Query Type from Select Query (the default type) to the
appropriate Query Type from the Query Type drop-down menu on the toolbar:
Make-Table Query: The purpose of a Make Table Query is to create a new Table based on the
specific Fields and Records you choose in the Design View.
Append Query: The purpose of an Append Query is to add new records from one Table to another
Table that already exists in your database.
Delete Query: A Delete Query deletes a set of records from one or more Tables. For example,
you could use a Delete Query to remove employees with disability. With Delete Queries, you
always delete entire records, not just selected Fields within records. You can use a Delete Query
to delete records from a single Table, from multiple Tables in a one-to-one relationship, or from
multiple Tables in a one-to-many relationship, if cascading deletes are enabled. For example, you
could use a delete Query to delete all employees of a department. However, you cannot delete
records from the primary Table and the related Tables at the same time. For example, you could
not delete a department when it has employees in it. You would need to run the Query to delete
all employees of the department and then run it again to delete the department in the primary table.
Update Query: An Update Query can be used to make a global change to all records where the
data matches certain criteria.
Top Query
There are times when you only want to see a few of the top results from the query i.e. display a
certain number of results by using the Top Values Box. This is located in the toolbar near the Run
Query (!) button. You can use this box to enter a number of values here or a percentage of the total
records which are displayed in the results window.

Access Forms
Forms are used to create a friendly data-entry interface to enter information into tables and/or
queries; to create custom dialog boxes to carry out actions; or to create switchboards for users to
open other forms and/or run reports. Bound forms are forms that are created from other database
objects, such as tables or queries. Unbound forms are forms created to carry out user’s action,
such as opening other forms or running reports.
With the help of queries and relationships, they allow you to enter data into more than one table
at a time. If your database tables are linked with relationships that enforce referential integrity,

ITM (Page - 58)


forms allow you to look up records and data from the primary table (main form) and add or edit
data in the related table (subform), so you can easily maintain referential integrity.
There are different ways of creating forms: Using AutoForm, Form Wizard and Design View

Creating a Form using AutoForm


One can use AutoForm option when one needs to view just one record at a time. When you create
an AutoForm, Access will automatically add all of the fields to the form from the table or query
you create the form from.

Creating a Form with the Form Wizard


The Form Wizard is another way to create a Form quickly in Access. The Form Wizard allows
you many different options, such as, choosing multiple tables and/or queries to create a form,
selecting which fields you want to appear in the form, choosing the type of layout you want your
form to be in , and what kind of background you want on your form.
If you are building a form from a query of related tables with a one-to-many relationship, the
Wizard asks:
• How you want to view your data (in terms of one table or another)
• How to build the form: A form with a subform or two linked

Creating a Form in Design View


You also have the option to create forms in Design View. This allows you to create the form from
scratch, so that you can choose your fields, formats, and layout.

Using Controls in a Form


Sometimes you might be needed to add controls to your form. Some of these controls could be
combo boxes, check boxes, list boxes, and command button. In order to add these types of control,
you’ll need to utilize the Toolbox Toolbar.
Text Box: A text box is used to display data from a source. It can be bound text box when it is
bound to a field. It can be unbound for which the values are not stored anywhere.
Check Box: A check box can be used to indicate an “On/Off”, “Yes/No”, or “True False”
condition. This control is bound to a Yes/No datatype field in a table or query.
Option Button: An option button is used to display a Yes/No value from a source.
Option Group: An option group is used to display a limited set of alternatives to choose from.
List Box: A List box can contain multiple columns and is good for short lists of information. The
user can scroll through the list box or choose one item from a list box.

ITM (Page - 59)


Combo Box: A Combo box is like a text box and a list box combined. You can usually either
choose an option from the drop-down list in the box, or you can type in your own.
Command Button: Command buttons are useful when you want a user to be able to click, double
click, or use the mouse in some other way to make something happen, such as print a form or look
for information inside of a form.

Access Reports
A report is an effective way to present your data in a printed format because you have more control
over the appearance of everything on the report. Most of the information in a report comes from
an underlying table, query which is the source of the report's data.

Create a report with the Report wizard


Using the Report wizard is the simplest and fastest way to create a report. The Report wizard
speeds up the process of creating a report because it does all the basic work for you. In the first
screen of the Report wizard, you can pick the fields you want to include in your report. These
fields can be from one table or from multiple tables.

Exercise-8
We will be using the database created in earlier class: Staff.accdb

1) Crosstab Query: Create a Crosstab Query to find the number of employees in each department
who have a specific Ethnicity or Nationality based on tbl_Employees. What are your row heading
and column heading fields. Which aggregate function is to be used? Save query as Query1

2) Make-Table Query: The Sales Manager has requested a Table containing information about
all the current Employees in his Department. Take all fields of tbl_Employees. Next, add
appropriate criteria to include only Employees in the Sales Department (Dept_ID is 100) who are
current employees (the Field named Date_Left contains the last day of employment for each staff
member and if this Field is null (empty) the person is a current employee). Amend the Query so
that the Dept_ID Field and the Date_Left Field are not displayed when the Query is run. Change
the Query to a Make-Table Query to make a Table called tbl_Employees_Sales. Save query as
Query2
Suppose you did not have an Ethnicity table and you are asked to create a new table ethnicity by
selecting ethnicity field from tbl_Employees. Use Make-Table Query to and Add Grouping so that
each ethnicity is displayed only once. Save query as Query3
3) Append Query: You are going to add some new departments to tbl_Departments using an
Append Query. The records you wish to append are in tbl_Departments_append. Create Query

ITM (Page - 60)


and add the appropriate Table and add all the Fields. Make this Query into an Append Query and
select the appropriate Destination Table. Save query as Query4

4) Delete Query: The company has decide to delete records of past employees from the database
who left the company before January 2003. Open tbl_Employees and view the data. Note in
particular the data in the Field named Date_Left which contains the last day of employment for
each staff member. Change the Query into a Delete Query. Save query as Query5

5) Update Query: Human Resources have decided that the longest notice period for any
Department should be two months. Create an Update Query to change all Departments with a
notice period of 3 months to a notice period of 2 months. Save query as Query6

6) Top Query: You want to see the 5 longest serving employees in your company. Their first
SalaryDate indicates when they commenced their employment with the company. Use the Tables
tbl_Employees and tbl_Salaries. Save query as Query7

Exercise on Forms
Task One: Using AutoForm

1. Create a Form based on tbl_Departments using AutoForm Columnar


 include all Fields and name the Form ‘frm_Departments’
Task Two: Using the Form Wizard

1. Open tbl_Employees in Datasheet view and observe the types of Data stored. Are there any
combo boxes (drop-down lists) and check boxes. Close the Table.
2. Create a Form based on tbl_Employees using the Form Wizard:
 include all Fields except Telephone and Date_Left
 choose a Columnar layout
 choose the Standard style
 name the Form ‘frm_Employees’

Task Three: Resizing and moving

1. Open the Form in Design View and re-arrange the controls on the Form so that they appear
in three columns as below. Keep the Labels with their associated bound Controls:
Staff_ID Nationality Job_Title
First_Name Ethnicity Dept_ID
Last_Name Disability Notes
Date of Birth (DOB)
Task Four: Labels and formatting

ITM (Page - 61)


Change the text in any Labels where there is an underscore [ _ ] to replace the underscore with a
space. Left-align the text in the Dept_ID text box and increase the size of the Form Header so the
area is visible. Add a Label at the left-hand side of the Header with a suitable heading for the
Form. Change the font size of the Label in the Header section to 14 and change the font colour to
a colour of your choice.

Additional Task: Modifying a Form


Open the Form frm_employees. Select all the Controls in the Detail section of the Form and
move them down by one row of the grid. Add a Label above the first two columns with the text
‘Personal Information’ and one above the third column with the text ‘Job-related Information’.
Add a background colour to the Labels you have just added.
Task Five: Adding controls

1. Open the Form frm_Employees in Design view. Insert the picture logo.jpg at the right-hand
side of the Form header. Resize the picture using the corner handles so that it is fully visible.
2. Add the Telephone Field to the Form:
 Use the Field List to add the Telephone Field to the Form.
 Place it under the Disability Field.
Task Six: Properties

View the Properties for the Telephone text box. Change the Format Property of the DOB text
box to Long Date and view the changes in Form view. Resize the text box to fit the data.
Task Seven: Subform using the Control Wizard

1. Create a Subform below existing fields of frm_Employees based on tbl_Salaries. Include


the all the Fields from tbl_Salaries.
2. View the Employees Form and Salary records in the Subform. Adjust the size of the
Subform until all Salary records are fully displayed.
3. View the Properties of the Subform. Which Fields are linked?
Subform Field:
Mainform Field:
4. Change the text of the Subform Label to read ‘Salary Details’.
5. Add a new salary record to the employee with Staff_ID 00001 as below:
 Salary_Date: 01/04/03
 Salary: 25000
Additional Task: Subform using the Form Wizard

1. Create a Mainform with Subform using the Form Wizard:


 Base the Mainform on tbl_Departments and add all Fields

ITM (Page - 62)


 Base the Subform on tbl_Employees and add Staff_ID, First_Name, Job_Title and
Dept_ID Fields.
 Choose Datasheet style for your Subform. Name the Mainform
frm_Departments_mainform and name the Subform frm_Employees_subform
2. View the Form in Form View and view the Employee records in the Subform. Switch
between the two views, adjusting the size of the Subform until all Employee records are fully
displayed.
3. View the Properties of the Subform. Which Fields are linked?
Subform Field:
Mainform Field:
4. Change the text of the Subform Label to read ‘Employees in this department’
5. Add a new Employee with Staff_ID 50 to the Department with Dept_ID of 500.
Open tbl_Employees in Datasheet view to check that the correct Dept_ID has been added.
Task Eight: Using the Report Wizard

1. Create a Report based on tbl_Employees using the Report Wizard:


 Add First_Name, Last_Name, DOB, Job_Title, Telephone and Disability Fields
 Sort by Last_Name
 Chose Portrait Orientation
 Name the Report ‘rpt_Employees’
 Leave all other options as the default settings
2. View the Report in Print Preview and then switch to Design View.
Additional Task: Modifying a report

1. Add the Ethnicity and Nationality Fields, moving the Labels to the Page Header and
positioning the Labels and Field Controls appropriately.
2. Change the Page Orientation to Landscape and view the results.
Task Nine: Grouping and Sorting

1. Create a Report based on tbl_Departments and tbl_Employees using the Report Wizard:
 Add Dept_ID and Dept_Name from tbl_Departments in that order.
 Add Last_Name, First_Name, Job_Title and Telephone in that order
 Name the Report ‘rpt_Employees_Departments’
 View the Report in Design View and view Grouping and Sorting Properties. What
is the Report grouped by? Modify the Grouping and Sorting Properties so that the
Employees appear in order of Last Name within each Department.
Task Ten - Parameters on a Report

1. Open rpt_Employees_Departments in Design View.


2. Add a Parameter Field to display the name of the person who last edited the Report.

ITM (Page - 63)


 Add a Text Box and Label to the Report Header
 Type ‘Last edited by’ in the Label
 Add a Parameter to the Text box with the text ‘Enter your name below’

ITM (Page - 64)


Practice Exercises for Sessions
Step 1: Create the following tables in Access

Customer

Field Name Data Type Description


CustomerID Number The Unique Identifier for a Customer
Name Text The Name of the Customer
Address Text The Address of the Customer
City Text The City of the Customer
State Text The home State of the Customer
Zip Text The Zip Code of the Customer

Define CustomerId field as Primary Key for the Customer table

Account

Field Name Data Type Description


CustomerID Number The Unique Identifier for a Customer
AccountNumber Number The Unique Identifier for a Bank Account
AccountType Text The type of account (Checking, savings, etc.)
DateOpened Date The date the account was opened
Balance Number The current balance (money) in this account (in Rs)

Define AccountNumber field as Primary Key for the Accounts table.

Step 2: Enter the following data in Excel Sheet

Customer

CustomerID Name Address City State Zip


1001 Kavita Lajpat Nagar Delhi Delhi 110045
1002 Neetu South Ex Delhi Delhi 110048
1003 Sumit Sector -4 Noida UP 208023
1004 Ajit Sector - 15 Greater Noida UP 203456
1005 Karan Sector-18 Noida UP 208023
1006 Jatin South EX Delhi Delhi 110048

ITM (Page - 65)


1007 Rohan Gama 1 Greater Noida UP 203456
1008 Preeti R.K. Puram Delhi Delhi 110048
1009 Geeta Lajpat Nagar Delhi Delhi 110048
1010 Lokesh Sector 15 Noida UP 208023
1011 Simran Beta 2 Greater Noida UP 203456
1012 Hema Sector-14 Noida UP 110048
1013 Mohit Sarojini Nagar Delhi Delhi 110048
1014 Rakesh Sector 5 Noida UP 208023
1015 Abhijeet Beta 2 Greater Noida UP 203456
1016 Pooja Lajpat Nagar Delhi Delhi 110045
1017 Dhruv R.K. Puram Delhi Delhi 110045
1018 Yogesh Alfha -1 Greater Noida UP 203456
1019 Vinod Sector-6 Noida UP 208023
1020 Arun Sector 7 Noida UP 208023

Account :

CustomerID AccountNumber AccountType DateOpened Balance


1001 45678 Checking 10/12/1989 75446
1001 45679 Savings 10/12/1989 45643
1002 45680 Savings 1/5/1992 3423
1003 45681 Checking 12/1/1994 7453
1003 45682 Savings 12/1/1994 4565
1004 45683 Savings 8/22/1994 32545
1004 45684 Checking 11/13/1988 57897
1005 45685 Checking 10/12/1989 57757
1006 45686 Savings 10/12/1989 57457
1006 45687 Checking 1/5/1992 23432
1007 45688 Savings 12/1/1994 67575
1008 45689 Checking 12/1/1994 75764
1008 45690 Checking 8/22/1994 77575
1009 45691 Savings 11/13/1988 5654
1009 45692 Savings 10/12/1989 456456
1010 45693 Checking 10/12/1989 56464
1011 45694 Savings 1/5/1992 456445
1011 45695 Checking 12/1/1994 46436
1012 45696 Checking 12/1/1994 7000
1012 45697 Savings 8/22/1994 7865
1013 45698 Savings 11/13/1988 5757
1014 45699 Checking 10/12/1989 4566

ITM (Page - 66)


1015 45700 Savings 10/12/1989 8765
1016 45701 Checking 1/5/1992 45646
1016 45702 Savings 12/1/1994 57465
1017 45703 Savings 12/1/1994 35353
1018 45704 Checking 8/22/1994 5644
1019 45705 Savings 11/13/1998 46466
1020 45706 Checking 10/12/1998 435656

Step 3: Import records from Excel sheet to Ms Access database.

Step 4: Add 5 new Records for Customer (1021, 1022, 1023, 1024, and 1025) as well as in
Account table.

Step 4: Create Relationship between Customer and Account table.

Step 4: Create following queries and save them by the name of Question number ( Query
(a) , Query (b) ..) :

a) List all the details of customers having account balance more than 50,000 Rs.

ITM (Page - 67)


b) List all the customers who stay in Lajpat Nagar in Delhi .
c) List the name of the customers in descending order.
d) List the name of the customers having savings account and balance more than 40,000 Rs.
e) List the Account numbers opened between 1/5/1992 and 8/22/1994
f) Calculate the total balance available in the bank in Savings account and Checking
Account separately.
g) Calculate the sum of account balance of customers residing in Delhi.
h) List the minimum, maximum and average balance available.
i) Calculate the number of accounts opened by each customer in the bank.(customer one 2
if have both saving as well as checking otherwise 1 if he has only one type of account )
j) List the city and state for each customer in the following way:

k) Use input box property to check the details of specific customer’s account.
l) List the cities uniquely in which customers are residing.
m) List the name of the customers starting with “R” alphabet.
n) Generate a query which will help user in getting the details of a specific customer.

ITM (Page - 68)


Step 5: Create Following Forms:

a) Create a Form using form Wizard which will display the details of the customer.
b) Create a form which will display the details of account of the customer.
c) Create the following form which will display the account details as well as customer
details.

Step 6: Generate following reports:

a) Generate report displaying the account details for each customer ID.

b) Generate a report which will display the sum of balance for both types of accounts in the
bank.
c) Generate a report which will display the account numbers sorted (Ascending order) on
the basis of date of opening account.

ITM (Page - 69)


d) Generate the following report :

ITM (Page - 70)

You might also like