You are on page 1of 12

UIT UNIVERSITY

CS-101 Introduction to Computer App.


Experiment # 04
Charts and graphs with Excel
Performed on ________________________

Student Name:
Roll Number:
Work submitted on:

Maximum Marks Performance = 05 Viva = 05 Total = 10

Marks Obtained

Remarks (if any)

Experiment evaluated by

Instructor Name: Engr.Rameen Anwar


Theory

The difference between graphs and charts is mainly in the way the data is compiled and
the way it is represented. Graphs are usually focused on raw data and showing the trends
and changes in that data over time. Charts are best used when data can be categorized or
averaged to create more simplistic and easily consumed figures. “So technically, charts
and graphs mean separate things, but in the real world.

Charts in Excel

Charts are usually considered more aesthetically pleasing than graphs.  Something like a
pie chart is used to convey to readers the relative share of a particular segment of the data
set with respect to other segments that are available. If instead of the changes in hours
worked and annual leaves over 5 years, you want to present the percentage
contributions of the different types of tasks that make up a 40 hour work week for
employees in your organization then you can definitely insert a pie chart into your
spreadsheet for the desired impact.

Graphs in Excel

Graphs represent variations in values of data points over a given duration of time. They
are simpler than charts because you are dealing with different data parameters.
Comparing and contrasting segments of the same set against one another is more difficult.

So if you are trying to see how the number of hours worked per week and the
frequency of annual leaves for employees in your company has fluctuated over the past
5 years, you can create a simple line graph and track the spikes and dips to get a fair idea.
A B c D
Year Average Annual Compensation/Employee Average Hours Worked/Week Average Annual Leaves/Employee
1990 $20,000 38
1991 $23,000 41 2.7
1992 $18,000 40
1993 $25,000 35
1994 $26, 780 43

: t:::=:------------~
20-+--------------~
~Avtrace Hours
Worked/Werk

15 -+-~~~~~~~~~~~~~~ -..Aver1Se Annual


lu~Emp\oyee
10-+-----

520,000 523,000 518,000 525,000 526,780


19"0 1991 1992 1993 1994

An
example of a graph in Excel.

Types of Graphs Available in Excel


Excel offers three varieties of graphs:

● Line Graphs: Both 2 dimensional and three dimensional line graphs are available
in all the versions of Microsoft Excel. Line graphs are great for showing trends over
time. Simultaneously plot more than one data parameter – like employee
compensation, average number of hours worked in a week and average
number of annual leaves against the same X axis or time.

● Column Graphs: Column graphs also help viewers see how parameters change
over time. But they can be called “graphs” when only a single data parameter is
used. If multiple parameters are called into action, viewers can’t really get any
insights about how each individual parameter has changed. As you can see in the
Column graph below, average numbers of hours worked in a week and average
number of annual leaves when plotted side by side do not provide the same clarity
as the Line graph.

● Bar Graphs: Bar graphs are very similar to column graphs but here the constant
parameter (say time) is assigned to the Y axis and the variables are plotted against
the X axis.

How to Enter Data in Excel

1. Open an excel worksheet


2. In the first row, label column A as “Before”, column B as “After”, and column C as
“Difference”
3. Enter raw data into the Before and After columns (see image below)
Boolcl • Microsoft Excel
Insert Page layout formulas Data Review View Add-Ins

""""' Ji,
o~ . = = = [E
·~ ·~ ~·
Calibri • 11 K A ~ General

. -s
Paste

Clipboard Ii
B I

Font
&·A.
- Ii
= = = =r:

Alignment
=:

Ii
s •• ,. '
Number
+.o ..oo
.oo +.o

E13 • Ix
A B c D E F G H
1 Before After Difference
2 142 140
3 140 136
4 144 147
5 144 139
6 142 143
7 146 142
8 149 145
9 148 145
10 142 138
11 148 146
12
4. In the “Difference” column, enter a function (aka an equation or formula) to tell
Excel to subtract the before values from the after values.
a. Always start a formula with a “=” symbol, then select the cell from column B,
then type a “-“ symbol, then select the cell from column A, then hit enter.
b. The result will be displayed when you hit the enter key (see “-2” and “-4”
shown in cells C2 and C3 below). The formula is shown in cell C4.
c. Once you type in the formula, you can copy and paste that formula into the
remaining cells of column C.
d. If you want to calculate a paired t-test by hand, you will need these difference
values. Otherwise, you will not use them to make your graphs or analyses.

@\_Q."!·~£... J5d@) • Bookl - Microsoft Excel


I
Home Insert Page Layout Formulas Data Review View Add-Ins p
,-e,
JI. IK A.I L- = =ll~·J ~
0 Qi!!
J_calibri ·Ju • General

Paste
::J [e I Y ·IIH:·ll&·A·I I== =Jl'i~f~I W· Is·% ' ][···.oo +.o···1
.•

Clipboard rv Font Alignment Number

C6

A J B J c I D I E I f J G J H_l
1 Before After Difference
2 142 140 -2
3 140 136 -4
4 144 147 =B4-A4
5 144 139
-
6 142 143
7 146 142
B 149 145
9 148 145
10 142 138
11 148 146
How to Calculate Summary Statistics in Excel: Two Methods

1. Use the data analysis tools.

a. Open the worksheet with your data. Select the “Data” tab , then “Data
Analysis” , then from the list choose “Descriptive Statistics” and select
“OK” .
Bookl • Microsoft Excel

V1tw Add-Ins Acrobat


l.iJ Connections ~l
2J
Gtt External Rt'rt h
c Pr ml1
Sort
A

Tut to
a-
Rtmovt
~ Data Vahdatron •
'.E• Consolidate
~Group•
..;. Ungroup •

Data· Al Ed t l nks fl Fitter ~ Advanced Columns Duplicates !1 What.If Analym • :iLJ Subtotal
Conntd1ons Sort"' F1 rt, Data Tool. Out!,nt r.
cu /,, :811-All
A B c D E F G H K L IV
1 Before After Difference
2 142 140 ·2
Data Analysis
3 140 136 -4
4 144 147 3 e.,,alYS&S Tools
5 144 139 .5 Anova: Two-factor Without Repicabon
Correlation
6 142 143 1
. ..
Covariance

7
8
9
146
149
148
142
145
145
-4
-4
-3
Exponential Smoothng
F-Test Two·San'4* for Variances
FOlrier Analysis
HstO!l(am
r.
10 142 138 .4 Moving Average
Random tuT'ber Generation
11 148 146 ·2
iz

b. From here, with your cursor in the Input Range , select your data in column
A. Then put your cursor in the Output Range block and select an empty cell
in your work sheet. Click the box labeled “Summary Statistics” so a check
mark appears, then select “OK” .
Bookl • Microsoft Excel
Data Vi<w Add-Ins Acrobat

a-~ ~
R~ltW

_j

Gtt External Rtlr


..
, • ~ cenneenens A I nffl
z+ ".1lij
I! Sort
Data Vahdallon •
!E• Consol1datt
~Group·
.:> Ungroup • -
".1:;i Data Analym
?,.Solvtr
Data· Ed t Unks
Descriptive Statistics
Connections Sort Analys11
Cll
A B
/. -an-sn
C D
Input
['l'Ut Rangi,: CD SAS2:SAS11
o c_oums
OK

K L M
Gr~By:
1 Before After Difference
&ows
2 142 140 ·2 El L.abels In first row
3 140 136 -4
4 144 147 3 Output options
5
6
144
142
139
143
.5
1
O QutputRangi,:
New Workshttt E:fy:
CD SASIS

7 146 142 -4 New ~orld>ook


8 149 145 ·4
9 148 145 .3
3 0 ~Y statistics

10 142 138
El COQfidence Level for Mean: %
·4
[J Kth L~gest:
11 148 146 ·2
iz EJ Kth $filalest:
13
14
c. Excel will now show you the summary statistics. I have added highlights to
show the mean, standard deviation, standard error, and sample size which
are the summary statistics that you will most commonly use for your write-ups
in our labs.

Excel wor
Insert Page Layout Formulas Data
~
. A°
D "
.,tii
Calibri

[s
• 11

&-~·I
A· 1 = = =
Paste
.:/ I l1 >r- = = =
Clip boa ... r,; Font l"i

E16 !,.
A B c
1 Before Aher Difference
2 142 140 -2
3 140 136 -4
4 144 147 3
5 144 139 -5
6 142 143 1
7 146 142 -4
8 149 145 -4
9 148 145 -3
10 142 138 -4
11 148 146 -2
12
13
14
15 Columnl
16
17 Mean 144.5
18 ndanlError :0.98036
19 Median 144
20 Mode 142
21 Standard Deviation 3.1001792
22 Sample Variance 9.6111111
23 Kurtosis -1.4032926
24 Skewness 0.1957746
25 Range 9
26 Minimum 140
27 Maximum 149
28 Sum 1445
29 !Count 10
~n I
OR
2. Type in the formulas. For any formula, you can then copy/paste into cells for
adjacent columns (be sure to check that excel is using the correct cells to
calculate the values)

a. Mean: the formula to tell Excel to calculate a mean is “=average(select


cells here)” . Type this formula into the appropriate cell and then hit enter.
b. Standard Deviation: the formula to tell Excel to calculate a standard
deviation is “=stdev(select cells here)” . Type this formula into the appropriate
cell and then hit enter.
c. Sample size: the formula to tell Excel to calculate your sample size is
“=count(select cells here)” . Type this formula into the appropriate cell and
then hit enter.
d. Standard Error: The standard error is the standard deviation divided by the
square root of the sample size. Therefore, the formula to tell Excel to
calculate a standard error is “=[select the cell for standard
deviation]/sqrt([cell for sample size])” . Type this formula into the appropriate
cell and then hit enter.

Excel worksheet to make screen shots for Bio 353 lab n

Formulas Data ReV1ew View Add-Ins Acrobat

Paste
'I,
:,U

:I
Calibri

8 I y .
• 11

.
.
<'.';,.
A"

-
A•

A .
- •- ,. 1, e,
II:
-1~- dWrapText

!11 Merge & Center •


General

Chpb Font Alignment Number


A19 t,. I Standard Error ,-----
A 8 c D
1 Before After Difference
2 142 140 -2
3 140 136 -4
4 144 147 3
5 144 139 -5
6 142 143 1
7 146 142 ·4
8 149 145 ·4
9 148 145 ·3
10 142 138 -4
11 Descriptive Statistic 148 146 -2
12
13 Mean
14
144.5 =AVERAGE(C2:Cll) =AVERAGE(D2:Dll) CD
15 -;:::;:::::a;;:~:;;:::--~~~3~.~1001;;;-:;~;206~::n~~d~:CU:;::;-;~---::::;;;~;;;:;~;---i@
Stinlenl Deviation
16
17 Sa
18
Size 10 •COUNT C2:C11 aCQUNT 02.011 0
19 Standard Error
~~~~~~~~~- 0.980362745 =C15/SQRT(C17) =015/SQRT(Dl 7) @
?n
How to Create Graphs in Excel

1. Plot the means.


a. In this example, you will
plot frog heart rate before
and after treatment with
two drugs (epinephrine, ~ :J ~ itx
Rtv1"

. -. ..
SampleFrog Hean Data for First lab For Students_w,th Anal}'S6XIS3
Oat, v Ad<Ho

.,
l2.
Ac >bilt

•.)
s,.,,r OtJ'l•r ""
A

-·-
PlvotT•bl hbl, Plcturt Op S~pH SrNrtA.rt ColUf"'ft Lon• Pot hr Hyptrla Tl
nicotine). First, calculate Art
Chorts
ChMts • a.

your descriptive statistics E28 t;


by one of the methods A B 0 c G H
1 E mi, hnne Nicotine
shown above and 2 Hean rate (bpm) Contractoon Strength (g) Heart rate (bpm) Contractoon Strength (g)

organize your results 3 Fr


4
#
1
before
47 3
after
616
before
00014
after
00017
before
54 5
after
52.3
before
00017
after
00014
below the columns of data 5 2 75 4 65 7 00083 00084 49 2 98 00097 00092

as shown . 6
7
3
4
59 0
71 0
600
72 2
00013
00027
00015
00026
59 0
67 0
55 0
700
00014
00031
00014
00028
b. Holding the CTRL button 8 5 586
477
59 0 00040
00047
00040
00070
56 2
611
56 6 00047 00046
00061
9 6 55 3 52 2 00069
on your keyboard, select 10 7 49 4 45 8 00036 00041 63 5 377 00047 00030

the “Before” value for


11 8 651 71 3 00100 00092 79 7 67 8 00073 00088
12 9 39.5 42 0 0.0062 0.0058 49 0 405 00053 00052
epinephrine and then for 13
14
10
11
27 0
51 2
47 4
591
00052
00018
00022
00020
300
581
288
59 1
00046
00018
00038
00013
nicotine . 15 12 401 505 00036 00034 480 44 6 00010 00020
16 13 57 0 56 0 00068 00065 580 53 0 00129 00129
c. Select the “Insert” tab , 17 14 44 4 44 3 00026 00030 54 0 55 0 00029 00134

then Column , then Under 18


19
15
16
480
400
76 0
42 0
00067
00029
00049
00017
530
600
64 0
54 0
00050
00035
00052
00035
2D columns, select the 20 17 44 4 480 00076 00070 50 4 49 8 00058 00060
21 18 27 3 22 6 00016 00017 34 3 31 6 00015 00015
first option. When you 22 19 46 7 49 9 04550 04910 54 1 56 9 0 7020 06020

click this option, 23


24 mean ~ 5471®494 00414
CD 25 Sid err 29
55 2
33
00282
00237
0 0299!
00256 25 33 00367
00365
00314

you will see the image below.

d. Note that “Series 1” is your “Before” values (we’ll re-name this in a minute).
Li..1~ . Sample Frog Hean Data for Forst lab For Student... Chart Tools

Homt lnsut Page Layout Formulas Data RtVttW View Acrobat Ots1gn Layout Forma

:a
Paste
,I(
..a
Cal1bn (Body)

B I II
• 10

0 ~-~·
A' A
-., -• • 1~
iJI!
J
, •l % ~ .;'J

c b Ahgnment Number

Chart 6 t:
A B --c 0 E H F G
1 E me hrone Nocotone
2 Heart rate (bpm) Contraction Strength (g) Heart rate (bpm) Contraction Strength (g)
3 Fro # before after before after before after before after I
4 1 47.3 61.6 0 0014 00017 54.5 52 3 0.0017 0 0014
5 2 7~· '\192
6 3 5 56.0 014
7 4 7 55.0 028
8 5 ()46
54.0
9 6 4 061
53.0
10 7 4 030
11 8 6 52.0 ()88
12 9 3 51.0 052
13 10 2· • Serlesl !)38
50.0
14 11 5 013
15 12 4 49.0 020
16 13 5 48.0 129
17 14 134
47.0
18 15 052
19 16 46.0 035
20 17 060
21 18 2,. J)15
22 19 46.7 49.9 0 4550 0.4910 54.1 569 0.7020 0 6020
23
24 mean 49 41 55 2 0 0282 0 0299! 54 11 49 4 0 0414 0 0365
25 Sid err 29 3.3 00237 00256 25 33 00367 00314
e. Now we need to add the “After” values in a second “series”. To do this, be
sure to click the chart which will activate the “Chart Tools” area. In this area,
select the “Design” tab, then “Select Data”, then “Add”.
Sample Frog Heart Data f0< Fom lab fO< Students_with Anal_ Chart Tools
Form..ibo< o,u1 RfW"' \lf'J/t Adc:H'\S ACTob(DOff.19" __ fo_rm.,_t"'!
-layo_ut

Changt
(t,MfT>
Savt As
• T•f"I
-,,
I I I I
0""1

C24 f,. =AVERAGE(C4:C22)


A B C O E G H N
1 E onephnne Nocobne
2 Heart rate
3 Fro # before aft ~Kl Data Source
4 1 47 3
5 2 7
6 3 5 56.
7 4 7 55.
8 5
9 6
10 7 4
11 8 6
12 9 3
13 10 2
14 11 5
15 12 4
16 13 5
17 14
18 15
19 16 46. I Hidden OM Em!)<y <:els • °" cancel

20 17 4
21 18 2 b15
22 19 46.7 49.9 0.4550 0.4910 54.1 56.9 0.7020 0.6020
23
24 mean 49 4 55 2 00282 00299 54 7 49 4 0 0414 0 0365
25 sld err 29 33 00237 00256 25 33 00367 00314

f. For series name, type “After” . Note that a nonsense character automatically
occurs for the Series values . Delete this. With your cursor in this box, hold
the CTRL key and then select the after values for Heart Rate for
Epinephrine (cell C24) and Nicotine (cell G24). Click “OK” here and on the
next screen.
_ .._
• Sampe Frog
........... ........ ... °""'- ,.....
Dall for I n1 lM> I« Studmls_w,thAnal...,

- --I
tt,e,-,,

I I I
.. ·-
I...... ..,...I

H< .,
B

I I~
c
r
•AVERAGEIC4:C22)
' ~,.
0

ce « .
E

(O
G H -I N -
bef ire t>•cv ~
47 3 8t 8 000!4 00017 00014
7~ • • --"4)92

8 5! 60.0 014
7 7' 028
8 51 50.0 046
9 41 061
10 4! 40.0 ::'""G) 030
11 6! 088
12 31 30.0 :;''""G) ..., 052
,.
13 10
11
2,
5' 20.0
038
i.sz 013
15 12 4C 020
16
17 ,.
13 5,
4• 10.0
129
134
18 15 41 052
19
20
21
18
17
18
..
4(

21
0.0 035
080
015
22 t9 48 7 49 9 04550 04910 54 1 589 07020 08020
23
24' moen 49 4t:::][fil 00282 00299 54 7 494 004!4 00365
25 29 33 002 7 0 5 3 00367 0 t4
"''
g. We usually want the y-axis to go to zero when presenting data. To do this,
right click on your y-axis and select “Format Axis”. Select “Axis
Options”>“Minimum”>“Fixed” and then enter a “0”. Click “Close”.
h. Now you will see the basic graph (image not shown). Next, you can fix the
labeling.

2. Label the graph


a. First, let’s fix the series 1 name and the names of the components of the
series.
b. Click on the graph to bring up the Chart Tools tab. Select Design>Select
Data>Series 1>Edit (on the Legend Entries side of the box). Then type in
“Before” for the series name and click “OK”.
c. Click on the graph to bring up the Chart Tools tab. Select Design>Select
Data>Series 1>Edit (on the Horizontal Axes Legend side of the box). Then
type in “Epinephrine,Nicotine”, with the labels separated by a comma and no
space after the comma (otherwise your label will be moved over a space
when placed on your axis). Click “OK”, then click “OK” again. Now your graph
has the data labeled correctly and you need only to add labels to your axes.
d. To label the x-axis, click on the graph to bring up the Chart Tools tab. Select
Layout >Axis Titles >Primary Horizontal Axis>Title Below Axis. Now a title
will appear at the x-axis on your graph; click in the text box and type your
title (e.g. Drug Treatment). Do the same for the y-axis, except choose
“Primary Vertical Axis”>“Rotated Title” to orient the text as shown below (be
sure to include units of measure in parentheses).
~ ., . Sample Frog Heart Data for First Lab For Student ..
Home Insert Page Layout Formulas Data ReV1ew View Acrobat

Chart Area

~ Format Selection
LI [[y ~
~
:;] Ji] ~ ~ ~ Ji] ~ -, ~ _J ~ __]
Picture Shapes Text Chart Alas Legend Data Data Axes Gndhnes Plot Chart Chart 3-0 Trendhne Lines Up/Do Error
~ Reset to Match Style Box Trtle • Trtles· Labels • Table • Area ... Wa • Floor • Rotation Bari Bars ...
Current Selection Insert Label Axe, Background Ana~s

L Chart 6 ~( .r..j
A B cD E F G H N 0 p a r=
1 Epinephrine Nicotine
2 Heart rate (bpm) Contraction Strength (g) Heart rate (bpm) Contraction Strength (g)
3 Fro # before after before after before after before after
4
5
1
2 ,..~
47.3
~~~
61.6
60.0
0.0014 0.0017
------····
54.5 52.3 0.0017 0.0014
~,192
6 3 014
7 4 7 .; 028
8 5 5 5 50.0 046
9 6 ·e..c: 40.0
061
10 7 QI
030
11 8
.,
Q.

088
~QI
30.0
12 9 3 e • Before
052
13 10 2, QI
20.0 !)38
14 11 5
~
er: •After 013
15 12 4 ..
t:
QI
10.0 020
129
16 13 5 :I:

17 14 4 0.0 134
18 15 Epinephrine Nicotine 052
19 16 035
20 17 @ Drug Treatment 060
21 18 21.- .{)15
22 19 46.7 49.9 0.4550 0.4910 54.1 56.9 0.7020 0.6020
23
24 mean 49 4 55 2 00282 0 0299 54 7 49 4 00414 0 0365
25 std err 29 33 00237 00256 2.5 33 00367 00314
3. Add the error bars. Do not use any of the default settings for error bars in Excel
as they are incorrect. You must calculate either standard error or standard deviation
and use these values to plot error bars on your graph. For this example, you will
plot ± 1 standard error for each error bar.

a. Click on the graph to bring up the Chart Tools tab. Select Layout>Error
Bars>More Error Bars options (the last choice on the drop down menu). To
place error bars for the before values, click on “Before” and then “OK”.
b. From this menu, choose “Custom” and “Specify Value”. For the Positive
Error Value , delete the nonsense characters. Hold the CTRL key and then
select the “Before” standard error value of heart rate for Epinephrine and then
for Nicotine. Repeat this process for the Negative Error Value . Select “OK”,
then “Close”. Now the error bars are plotted for the Before values. Repeat
this process for the After values.

ii;\~ _, ; Sample Frog Heart Data for First Lab For Students_withAnaL.

~sert PageLayout Formulas Data Revaew View Add-Ins Acrobat Oesogn Layout Format

Senes Before Y E~ Format Error Bars


A
~ FormatSt ection
Picture Shapes Text AlUS Axes Gndt es 3-D VertlallError Bers
::) Resetto Match St)'le Box Titles• Rotation
Vertical Error Bars
Currtnt Stlection Insert Labels BackgroundAnalysos LineColor Olsploy
Axes
Otrection
F25 Line Styte
Q ~oth
A B c D E F G Shodow JJ Custom Error Bars ~
1
2
3 Fro # before after
Epinephrine
Heart rate (bprn) Contraction Strength (g) Heart rate (bpm) Con
before after before after
Nicotm

befo
w l!llnus

PJus
fositille Error Volue

4 1 47.3 61.6 0.0014 0.0017 54.5 52.3 0 ~


5 2 7r~ ~o-e~,~~--~ EndStyte
60.0 uo a,p
6 3 5
7 4 7 ]' 50.0
._L] 5
8
9
10
6
5

7
5
4
4
::,
c
·e
~ 40.0
.,
w Q CAP

11 8 6
.,
Q.
Error Amount

12 9 3
.,
1'6 30.0
fixed value: j10.o
£
13 10 2, 1;! 20.0., fercentoge: 5.0
14 11 5
15 12 4 t: "...,
10.0
S.tondorddeviotion(s): 1.0
-----
:c Standard.e_rror
16 13
17 14 4 0.0 ~ ~ustom:
18 15 4 Epinephrine Nicotine
19 16 4
20 17 4 Drug Treatment
21 18 2
22 19 46.7 49.9 0.4550 0.4910 54.1 56.9 0 Close
23
24 mean 49.4 55.2 0.0282 0 0299 54.7 49.4 0.0414 0.0365
25 std err : 2.9~ 33 00237 0 0256:
~-·
2 5~ 33 00367 0 0314
4. Your graph is complete. Now that you know the basics, you can click on various
options and change colors, remove the grid lines, change font size, line
thickness, graph style etc.

You might also like