You are on page 1of 9

Introduction to Excel as an Analytical Tool

Excel Formulas and Functions

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.
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
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:
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.
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.

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
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.
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
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.

You might also like