CVE156 Chap3 Basics of Microsoft Excel
CVE156 Chap3 Basics of Microsoft Excel
CVE156 Chap3 Basics of Microsoft Excel
MDP_CVE156 1
Basics of Microsoft Excel
Chapter 3
MDP_CVE156 2
Content
MDP_CVE156 3
Objectives
▪ To understand cell referencing and how to apply Absolute and
Relative cell addressing
▪ To use Excel Built-in functions to build complex formulas used in
engineering practices
✓ SUM, MIN, MAX, AVERAGE, COUNT, COUNTA
✓ ROUND
✓ COUNTIF, SUMIF, AVERAGEIF
▪ To present our data with a best fit graphical representation in Excel
MDP_CVE156 4
CELL REFERENCING
CHAPTER 3
MDP_CVE156 5
3.1 Cell Referencing
MDP_CVE156 6
3.1.1 RELATIVE CELL REFERENCING
If the formula in cell B7 is copied into cell C7, one column to the right of the original
formula, the operands (B4,B5,B6) within the formula will change by the same relative
distance: one column to the right. The displacement from B7 to C7 is one column and zero
rows. This will result in the formula =C4+C5+C6.
Cell references such as B4, B5 and B6 are referred to as relative cell references.
MDP_CVE156 7
What formula will result if the formula =B2+C2/D4 is
copied from cell E8 to cell E12?
MDP_CVE156 8
What formula will result if the formula =B2+C2/D4 is copied
from cell E8 to cell E12?
MDP_CVE156 9
Relative Addressing- Example:
• This spreadsheet keeps track of a salesman’s monthly expenditures for travel and
lodging, as listed columns B and C respectively. All arrangements for this travel are
made by a local travel agent who charges a service fee of 5% of the base price.
MDP_CVE156 11
3.1.2 ABSOLUTE CELL REFERENCING
How can you write a formula in cell D6 to add 5% to the corresponding
base price cost?
MDP_CVE156 13
How can you write a formula in cell D6 to add 5% to the corresponding
base price cost?
What formula could you write in cell D5 to calculate total cost so that it can be copied both
down the column and across the row?
MDP_CVE156 15
What formula could you write in cell D5 to calculate total
cost so that it can be copied both down the column and
across the row?
A B C D E
1 Site A Site B
2 $/trip: $ 125 $ 175
3 # Trips:
4 Site A Site B Site A Site B
5 January 1 2 ???
6 February 2 2
7 March 4 2
MDP_CVE156 16
3.1.3 Mixed Cell Referencing
MDP_CVE156 17
3.1.3 Mixed Cell Referencing
Instead of costs per month, this worksheet calculates trip costs by
department; for the Sales Group and Service Group respectively.
Write a formula in cell E3, which can be copied across the row and down the
column, to calculate the total trip expenses for the Sales Group to Site A.
MDP_CVE156 18
3.1.3 Mixed Cell Referencing
To reference a cell Absolutely with respect to Column and
Relatively with respect to Row Use this notation : $B3
Write a formula in cell E3, which can be copied across the row and down the
column, to calculate the total trip expenses for the Sales Group to Site A.
MDP_CVE156 19
A Multiplication Table
What formula would you write in cell B2 to calculate the product. This
formula must work when copied down the column and across the row to
form the 5’s Multiplication table.
MDP_CVE156 20
Another convenience in Excel is the
ability to Name cells…
• Names can be assigned to cells.
• Name of a cell is a mapping to its absolute address.
• This name can now be used in formulas to refer to that cell.
It will be considered an absolute address.
• Select the cell you want to name, click on the Name Box,
enter name and then press Enter or use the Name
Manager tool located on the Formulas Ribbon.
MDP_CVE156 21
Can we use a named range for Service Fee?
MDP_CVE156 22
3.1.4 EXCEL ERROR VALUES
MDP_CVE156 23
3.2 Advanced Excel
Functions
CHAPTER 3
MDP_CVE156 24
3.2.1 Built-in Function
MDP_CVE156 25
MDP_CVE156 26
MDP_CVE156 27
MDP_CVE156 28
A Function is a predefined worksheet
formula
The advantage of
using a function:
• Saves time writing
• Simplifies complex calculations
• Faster execution
• Less chance of typographical errors
• Fewer characters in the formula bar
MDP_CVE156 29
Functions take arguments and return a result
MDP_CVE156 31
Arguments of a SUM function
MDP_CVE156 32
Using functions
MDP_CVE156 33
Using functions
=SUM(C5:F5)
MDP_CVE156 34
Function Wizard
• Function wizard: A short-cut to all the functions in excel
(use fx toolbar button) that walks you through building a
function
MDP_CVE156 35
Common Functions- with only a range argument
Where number1, number2 are 1 to 255 numeric arguments. Arguments can either be
numbers, ranged names or ranges of cell references which contain numbers.
MDP_CVE156 36
How a function’s algorithm can affect the resulting value
=COUNT(B5:B8)?
Use =COUNTA(B5:B8) → 2
If scores should only be reported as integers..
How can we fix this in Excel?
The Increase/Decrease
decimal buttons do NOT
change a value only how
the value is displayed.
MDP_CVE156 40
Syntax: Round (number, num_digits)
• = Round (24.44,1) results in the value 24.4
• The ROUND function can be part of a larger formula:
→ = ROUND(AVERAGE(C1:C10),-1)
MDP_CVE156 41
The ROUND function’s arguments are as follows:
• Number: The first argument is a single value that can be a constant, a cell
reference where the cell contains a numerical value, or a nested formula
that results in a single number value.
MDP_CVE156 42
The num_digits argument
• Positive num_digits
round to the specified
number of decimal
places
• A zero results in a whole
number
• Negative num_digits
round values to tens,
hundreds etc.
MDP_CVE156 43
Consider a spreadsheet with cell A1 containing the numeric value
78.43, and cell A2 containing the numeric value 78.686788. Here
are some additional examples of formulas using the ROUND
function:
MDP_CVE156 44
Consider a spreadsheet with cell A1 containing the numeric value
78.43, and cell A2 containing the numeric value 78.686788. Here
are some additional examples of formulas using the ROUND
function:
MDP_CVE156 45
Notice the Σ SUM gives different results
when adding rounded values
MDP_CVE156 46
Counting the number of honor students
MDP_CVE156 47
Use the COUNTIF Function
MDP_CVE156 48
The COUNTIF Function counts the number of items in a
range that meet a specific criteria.
COUNTIF (range*, criteria) –
Range - a continuous cell range
Criteria Syntax:
- A number 6 =COUNTIF(B2:B7,6)
- Text “USA” =COUNTIF(A1:A50,“USA”)
- A cell reference B2 =COUNTIF(C3:C10,B2)
- A Boolean expression “>5” =COUNTIF(A1:A10,“>5”)
* The comma tells the computer the next argument is the criteria – so you cannot
list individual cells separated by a comma for the range
MDP_CVE156 49
How many people scored above 6 points on either lab?
=COUNTIF(C5:C8,D5:D8, “>6”)
=COUNTIF(C5:D8, “>6”)
MDP_CVE156 50
How many people scored above 6 points on either lab?
=COUNTIF(C5:C8,D5:D8, “>6”) X
=COUNTIF(C5:D8, “>6”) √
MDP_CVE156 51
This worksheet lists the service ratings for several different phone providers by region
(East, Midwest, South and West). Each provider is given a rating on a 100 point scale,
where 100 is a perfect score.
A B C D E F G
Network
2 Type East Midwest South West Total
3 Total Possible points 100 100 100 100 400
4
5 BT&T H 81 90 88 86
6 Blue Phone B 53 80 77 55
7 Horizen H 51 70 91 90
8 Spuce B 90 75 82
9
10 Average 69 80 83 78
Question #1: Write an Excel formula to determine the number of rating scores for all
providers and all regions that received an unacceptable rating. The minimum acceptable
rating is 80. What value will result?
Question #2: Write an Excel formula in cell B12 (not shown) to determine the number of
networks of either type B or type Z.
MDP_CVE156 52
A B C D E F G
Network
2 Type East Midwest South West Total
3 Total Possible points 100 100 100 100 400
4
5 BT&T H 81 90 88 86
6 Blue Phone B 53 80 77 55
7 Horizen H 51 70 91 90
8 Spuce B 90 75 82
9
10 Average 69 80 83 78
Question #1: Write an Excel formula to determine the number of rating scores for
all providers and all regions that received an unacceptable rating. The minimum
acceptable rating is 80. What value will result?
=COUNTIF(C5:F8, “<80”)
Question #2: Write an Excel formula in cell B12 (not shown) to determine the
number of networks of either type B or type Z.
=COUNTIF(B5:B8,“B”)+COUNTIF(B5:B8,“Z”)
MDP_CVE156 53
The SUMIF Function sums the values in a range
that meet a specific criteria
SUMIF(range, criteria, sum-range)
Range – Continuous range used to compare the criteria
Criteria – Comparison Criteria
Sum-Range - If criteria is met, the computer will sum the
corresponding entry in this range
The syntax of the criteria is the same as the syntax of the
COUNTIF function:
- a number such as 6
- text such as “Honor”
- a Boolean value such as “<2”
- a cell reference such as A1
MDP_CVE156 54
Sumif Function
MDP_CVE156 55
Sumif Function
=SUMIF(B$2:B$6,A9, C$2:C$6)
MDP_CVE156 56
A B C D E F G
1 Service Ratings
Network
2 Type East Midwest South West Total
3 Total Possible points 100 100 100 100 400
4
5 BT&T H 81 90 88 86 345
6 Blue Phone B 53 80 77 55 265
7 Horizen H 51 70 91 90 302
8 Spuce B 90 75 82 247
9
# in Total Total Total Total Total - all
10 Summary Network East Midwest South West regions
11 H 2 132 160 179 176 647
12 B 2 143 80 152 137 512
13 Z 0 0 0 0 0 0
Question #1: Write an Excel formula to determine the total points awarded to
all type H network providers from all regions combined.
MDP_CVE156 57
A B C D E F G
1 Service Ratings
Network
2 Type East Midwest South West Total
3 Total Possible points 100 100 100 100 400
4
5 BT&T H 81 90 88 86 345
6 Blue Phone B 53 80 77 55 265
7 Horizen H 51 70 91 90 302
8 Spuce B 90 75 82 247
9
# in Total Total Total Total Total - all
10 Summary Network East Midwest South West regions
11 H 2 132 160 179 176 647
12 B 2 143 80 152 137 512
13 Z 0 0 0 0 0 0
Question #1: Write an Excel formula to determine the total points awarded to all
type H network providers from all regions combined.
=SUMIF(B5:B8,“H”, G5:G8)
=AVERAGEIF(B$2:B$6,A9, C$2:C$6)
MDP_CVE156 59
A little harder. Calculate the average cumulative for students by college by
year. The formula can be copied down and across.
MDP_CVE156 60
A little harder. Calculate the average cumulative for students by college by
year. The formula can be copied down and across.
=AVERAGEIF($B$3:$B$9,$B13,C$3:C$9)
Is this equivalent to a sumif/countif?
MDP_CVE156 61
Other Categories of Functions
•Statistics:
•Mean, Median, Standard
deviation
•Financial:
•Present value, Future value
•Logical:
•NOT, AND, OR
•Trigonometric:
•COS, TAN,
MDP_CVE156 62
3.3 Charts and Graphs
CHAPTER 3
MDP_CVE156 63
3.3 Charts
• Why are charts useful?
• Visual presentation of differences, similarities, general trends in data
• Easier to view and interpret at a glance
• Chart layout - terminology
• Types of charts
• Deciding which type of chart is appropriate for the problem at hand
MDP_CVE156 64
CHART LAYOUT & TERMINOLOGY
Chart Title Hotel Guests at The Bates Hotel
1200 Plot
Area
1000
Legend
800
General
Dollars
600 Business
Convention
400
200
Y Axis
0
Jan Feb Mar Apr May Jun
Month
X Axis Category-Axis Title
MDP_CVE156 65
SELECTING AN APPROPRIATE CHART TYPE
Not all types of charts are appropriate for all data presentation
needs
MDP_CVE156 66
A line chart shows a trend with each point
plotted at equal intervals
Time Temperature
Hourly Temperature 8:00 27
9:00 29
45 11:00 38
40
Temperature
35 12:00 38
30
25
20
13:00 38
15
10
14:00 39
5 16:00 38
0
17:00 36
18:00 30
21:00 28
Hour of Day 22:00 26
23:00 26
Notice how the distance on the x axis from 8-9am is the same as from 9-11am
MDP_CVE156 67
A Scatter (XY) chart plots two sets of data at scaled
intervals showing a functional relationship
$4,000 5% $ 500
6% $ 600
$3,000 10% $ 1,000
Earnings $
$-
0% 10% 20% 30% 40%
Interest Rate - Percent
Notice how the data points are not distributed evenly but along a scaled x axis of interest rate
MDP_CVE156 68
What type of chart best represent this data?
MDP_CVE156 69
Strength development of concrete samples with different water-to-cement (w/c) ratios
MDP_CVE156 70
What type of chart best represent this data?
MDP_CVE156 71
What type of chart best represent this data?
MDP_CVE156 72
Bar/Column Charts show and compare discrete
objects
Bar charts are graphs that use horizontal bars to represent a quantity for a
specific item.
Population
14
12 Philadelphia?
line chart
10
0
Boston Hartford NY Washington Miami
MDP_CVE156 73
Bar/Column Charts
City Population
Boston 7
Hartford 3
NY 12
Washington 6.5
Miami 8
Population Population
14
Population in Millions
12
Miami
10
8 Washington
6 NY
4
Hartford
2
0 Boston
NY
on
i
0 2 4 6 8 10 12 14
n
am
or
to
st
rtf
ng
Mi
Bo
Ha
hi
Population in Millions
as
W
The left-hand chart is a Column chart, and the right-hand chart is Bar chart. Each is equally good at displaying this
type of discreet data. Which one to choose is a matter of individual preference and limitations such as width and
length of the page.
MDP_CVE156 74
12 Clusters: Cluster Bar
and Column charts allow
10
0
Boston Hartf ord NY Washington Miami
populations for each city
1990
2000
6
7
3.3
3
11.7
12
6
6.5
7.3
8 for multiple years.
Population Decade Comparison - by City
sub-sections
Population in Millions
under 25 over 25
MDP_CVE156 75
Pie Charts display parts that make up a
whole
Population Comparisons
Miami Boston
22% 19%
City Population Hartford
Boston 7 8%
Hartford 3
NY 12
Washington 6.5
Washington
Miami 8
18%
NY
33%
MDP_CVE156 76
GOOD PRACTICES FOR CHARTS:
It’s always easy when working with a tool such as charting to either create charts that are
either poorly documented or overly busy or messy. Here are some good rules of thumb
for creating effective, readable charts – whether they be in Excel or anywhere else:
• Choose the correct chart type to convey the points you wish to make.
• Charts should appear neat and clean and be done as simply as possible to convey the
most important message. Well chosen colors and patterns clearly illustrate similarities
and differences.
• Charts should have titles that clearly indicate the subject matter.
• The axes scales should be clearly titled and delineated with well scaled and well
marked intervals. Unit values should reflect the needed “significance.” e.g., values in
the millions need not show decimal places.
• Data should be clearly marked with labels or on an accompanying legend/key.
• If a chart is rotated it should be readable either from the bottom or the right-hand
side of the page.
A good overall chart should be easy to read and tell a complete story which can stand
alone even without the text. When displaying data, it really is true that a picture is worth
a thousand words.
MDP_CVE156 77
Creating a Chart - Walkthrough:
MDP_CVE156 78
Editing a Chart: Walkthrough
Layout Ribbon
Format Ribbon
MDP_CVE156 79
Here is an example of “bad” and “good” figures. Here, we used a bar chart (Figure 5a) and a
line graph (Figure 5b) to present the strength development of concrete samples. Can you find
four reasons why Figure 5b is better than Figure 5a?
MDP_CVE156 80
First, bar charts are effective when comparing different samples, but it is unintuitive when
we want to see the strength development over time. The line chart, on the other hand,
connects each data point to show the increasing trend over time.
Second, the x-axis of the bar chart does not consider the time interval between each data
point. The line chart, however, uses time as the x- axis, so the time scale is represented
more accurately.
Third, the y-axis of the bar chart starts from a non-zero value. This could be misleading
because it seems like the w/c = 0.5 sample has a good strength at 1 day (Figure 5a), when
the value is actually close to zero (Figure 5b). This kind of mistake can happen when you
are using the default figure that your data visualization tool makes. Remember to adjust
the x and y-axes.
Lastly, the error bars were omitted in the bar chart. Again, always show the error bar, if
available.
MDP_CVE156 81