Using Excel For Analysing Survey Data
Using Excel For Analysing Survey Data
Cooperative Extension
Madison, Wisconsin G3658-14
PD&E
Program Development
Using Excel
for Analyzing Survey
Questionnaires
Jennifer Leahy
& Evaluation
Introduction Step 1
You have created, tested, and implemented a
survey, and now you would like to see the results
Create an Excel
of your work. This guide will help you set up a database
simple database in Microsoft Excel 2002 to When you open up Microsoft Excel, you will
analyze your survey data. Some steps may be see a blank worksheet. This worksheet is part of
slightly different in other versions of Microsoft a workbook. A workbook holds all of your
Excel.* worksheets, and is simply another name for an
This guide is organized in five steps: Excel file.
Step 1 Create an Excel database, page 1 A blank Excel worksheet is composed of a series
of vertical columns, horizontal rows, and individ-
Step 2 Code your data, page 6
ual cells (see Figure 1). You can select different
Step 3 Enter your data, page 7 worksheets by clicking on the tabs at the bottom
Step 4 Clean your data, page 8 of your workbook.
Step 5 Analyze your data, page 8 Columns are alphabetized A, B, C, D
Resources on page 28 include companion eval- from left to right across the top.
uation materials available online. You may find Rows are numbered 1, 2, 3, 4 from
these helpful as you use this booklet. top to bottom down the left of the worksheet.
Cells are individual boxes within the work-
sheet.
* Using this product example is not intended to endorse it over others that may be similar, but rather as a convenience to
readers. Microsoft Excel is a registered trademark of Microsoft Corporation in the United States and other countries.
Using Excel for Analyzing Survey Questionnaires is an independent publication and is not affiliated with, nor has it
been authorized, sponsored, or otherwise approved by Microsoft Corporation.
2 P R O G R A M D E V E L O P M E N T A N D E V A L U A T I O N
Worksheet
Columns
Cell
Row
Next, create column headers for each of the Adjusting column width
survey questions (see Figure 3). Decide which and row height
kind of header will work better for you.
You can adjust column width to fit your headers
You can label columns one of these ways: and data. However, keep the columns as narrow
For narrow columns, use the number of as possible. This allows more columns to be seen
each question Q1, Q2, Q3, Q4. at once and makes the database easier to navi-
Or use a descriptive header that encapsu- gate.
lates each questions meaning for instance, Adjust column width
if a question asks Do you smoke? the To adjust column width: Move your cursor
column header could be Smokes? over the top of the column you want to adjust.
Keep track of the header you give to each ques- The stretching tool will appear ( ).
tion. A good way to do this is to take a blank Click and hold the left mouse button over the
questionnaire and write the header next to each stretching tool. Then drag this to adjust the
question. This is your codebook. column size to be as wide or as narrow as you
Continue creating column headers until all ques- desire.
tions are labeled. Each question header is entered
Auto-format column width
into a separate column.
To auto-format column width: You can change
column width automatically either of these ways:
Figure 2: Create a database title Double-click on the stretching tool.
and column headers
Or select (highlight) the entire column or
columns you want to adjust.
This will change each column width to fit the After highlighting the cells or column(s), go to
widest label or value you entered in that column. the menu bar and select Format>>Cells. Select
If you have open-ended questions on your the Alignment tab at the top of the window
survey, see how to wrap text as shown in Figure that opens. Under Text control, select the
5 and Figure 6. Wrap Text option (see Figure 5).
Figure 5: Select Wrap Text
Adjust row height
To adjust row height: Move your cursor over
the row number on the far left. The stretching
tool will appear ( ).
Click and hold the left mouse button over the
stretching tool. Then drag this to change the row
height.
Wrap text
If you have open-ended questions on your
survey, you may need to format those columns in
your database to make room for the text.
Wrap text helps you see all of the text in the cell
regardless of the amount of narrative data.
To wrap text: First, highlight the cells in which
you want text to wrap. You may want to select an
entire column to wrap text for every response to
a question.
U S I N G E X C E L F O R A N A L Y Z I N G S U R V E Y Q U E S T I O N N A I R E S 5
Using Wrap Text will make your narrative data look like the text in Column E, Row 4 of Figure 6.
Figure 6: Text after using Wrap Text
Borders
Now that you have typed in all your column headers and formatted the columns, you may want to
draw a line under the headers to distinguish them from the data cells.
To underline headers: First, select and highlight Row 3 with all the column headers as shown in
Figure 7.
Figure 7: Select a row
6 P R O G R A M D E V E L O P M E N T A N D E V A L U A T I O N
Excel gives you two ways to create frequencies: To select a different worksheet: Click on the
COUNTIF function You type in formulas that appropriate tab at the bottom left-hand corner of
calculate frequencies. your worksheet (see Figure 12).
Figure 12: Frequency table created in a new sheet in the same workbook
To calculate the frequency for a question in Excel: Click on the function key that you see
next to the formula bar. Make sure the blank cell you originally selected is still highlighted by a thick
black outline. The Insert Function window will pop up as shown in Figure 14.
Figure 15: Choose Range and Criteria in the Function Arguments window
Range is the group of cells that contain the data you want to analyze.
To select a range: First, make sure your cursor is in the range field. Then go to your data work-
sheet, and use your mouse or keystrokes to highlight the data you want analyzed (see Figure 16).
To highlight data: Place your cursor in the top data cell of the data column for the question, and use
your mouse or keyboard as follows:
Hold down the mouse button and drag the cursor to the bottom cell of the data column.
Or hold down the shift key while using the down arrow key.
Or select data using cell labels.
A dotted line appears around the data you select.
In Excel, criteria means the code of the specific response item for which you want frequencies.
If you asked Do you smoke? and codes are 1 = No and 2 = Yes, to count the number of people who
answered No, criteria would be response code number 1.
To select criteria: In the Criteria field, type the code for the response item. Then click OK (see
Figure 17).
Figure 17: Type the criteria (response code)
After you have successfully created a COUNTIF formula, a number will appear in the cell. This is the
frequency.
For a completed frequency table, see Figure 8 below.
Percents
Using the frequency table you created with COUNTIF, you can create a table that shows percents for
your data. See Figure 19 for a completed table with percents.
To create percents using formulas in Excel:
First, create a frequency table for all possible response items by using the COUNTIF function. Then
calculate the total number of responses by summing all of the frequencies in your table.
To calculate percents: In a separate column, enter a formula to divide the frequency for each
response item by the total number of responses. For example, to calculate the percent of total Q1
respondents (28) who answered No (16), enter the formula =16/28 in the Percent column (see
Figure 18).
After you enter the formula into a cell, a figure will appear. This figure will begin with a decimal
point.
To make the resulting decimal look like a percent: Select the cells containing your intended
percents, then hit the % button located below the menu bar (see Figure 19).
Figure 19: Frequency table with percents
The % button
If you want, you can then delete the Frequency column by highlighting the cells you no longer
need in the Figure 19 example, cells C5 through C8. Then right-click over the highlighted cells and
select Delete. When prompted, select Move cells to the left to complete the table.
PivotTable frequencies
You can use the PivotTable Wizard in Excel to calculate frequencies and percents. Instead of creating
a formula for each response item, the PivotTable Wizard immediately displays in a table all of the
possible frequencies for your question.
To calculate frequencies using the PivotTable Wizard: Click on Data in the menu bar. Then
click on Create a PivotTable report or PivotChart report.
A window appears as in Figure 20. In this window, click on Microsoft list or database and
PivotTable. Then select Next >.
Figure 20: Create frequencies using PivotTable Wizard
U S I N G E X C E L F O R A N A L Y Z I N G S U R V E Y Q U E S T I O N N A I R E S 15
In the next screen (Figure 21), the PivotTable Wizard asks you to choose the data you want to use.
Begin with the cursor in the range field, and highlight all of your data or selected questions. Include
the question headers (see Figure 21). After you have selected your data, click Next >.
In the next screen (Figure 22), choose New worksheet. Then click Finish >.
Figure 22: Choose New worksheet
16 P R O G R A M D E V E L O P M E N T A N D E V A L U A T I O N
Excel then takes you to a screen that looks like Figure 23.
Figure 23: PivotTable row and data fields
Choose the question for which you want to create frequencies in the PivotTable Field List. Drag the
question header from the PivotTable Field List to the Drop Row Fields Here box in the
PivotTable (see Figure 24).
Figure 24: Drag the question header into the Drop Row Fields Here box
After you have dragged the question header to the Drop Row Fields Here box, the response items
will appear in the PivotTable.
U S I N G E X C E L F O R A N A L Y Z I N G S U R V E Y Q U E S T I O N N A I R E S 17
To make data appear in the PivotTable: Select your question from the PivotTable Field List
again. This time, drag the question into the field that says Drop Data Items Here (see Figure 25).
Figure 25: Drag the question header into the Drop Data Items Here box
You now have a PivotTable that lists the response items for the question you chose, and the response
items frequencies (see Figure 26).
Figure 26: Frequency PivotTable for Q1 Do you smoke?
Double-click here if it
does not say count.
When checking over your frequencies, make sure that the top left cell in the table says Count of [the
question you chose] (see Figure 26). If not, double-click on that cell.
This takes you to the PivotTable Field window. Go to the field below Summarize by: and select
Count (see Figure 27) to make sure you have frequencies.
Figure 27: Select Count
in the PivotTable Field window
18 P R O G R A M D E V E L O P M E N T A N D E V A L U A T I O N
Percents
To create a PivotTable with percents: First,
create a PivotTable with frequencies (see direc-
tions on pages ***-***). After you complete the Show percents as whole
frequency PivotTable: Double-click on the top numbers
left cell in your PivotTable that says Count of To round percents to the nearest whole
[question you chose]. number: In the PivotTable Field window,
In the PivotTable Field window, click on the choose the Number button, then choose %.
button that says Options>>. An extension From the field Decimal places, select the
appears. In the drop-down menu Show data number 0 to round to the nearest whole number.
as: select % of total (see Figure 29).
Click on OK in both windows, and your
PivotTable will show percents as in the Figure 30
example.
You will also round percents for PivotTable cross
tabs (Figure 38 and Figure 39 on page 27).
You can also use this process to round percents in
cross tabs created with the Pivot Table Wizard
(Figure 38 and figure 39 on page 27).
U S I N G E X C E L F O R A N A L Y Z I N G S U R V E Y Q U E S T I O N N A I R E S 19
2. While the blank cell is selected, type =AVERAGE( in the formula bar.
You can also type this into the blank cell, since the formula bar displays information typed in the cell
you selected, and vice versa.
The mean for the question you chose will appear Using the function key
in the cell where you entered your formula. In
To calculate a mean using the function key
the step 4 example, the mean is 1.43.
in Excel: Click on the function key. After
To round to a certain decimal point: You can you click on this key, the Insert function
use the button to round up by a decimal window appears. In this window, select
point. This button is located on the standard AVERAGE from the Select a function field,
toolbar. Click on the button as many times as nec- then click OK.
essary to round to the decimal point you desire.
After you click OK, the Function Arguments
window will appear. Select a range of data in this
Using the function key window (see Figure 31). You only need to select a
Do you want to calculate a mean, a mode, or a data range for the Number1 field, even though
median? A range or standard deviation? You can Excel gives you two fields for entering a range.
follow the Using the function key directions
If the Function Arguments window blocks
on this page to calculate any of these measures.
the data you want to select: Click on the ( )
button next to the Number1 field. Clicking this
button will collapse that window so only the
Number1 field appears while you select data.
After you finish selecting your data, click on the
( ) button again to make the rest of the
window reappear.
To calculate a median for a question in Excel: Or, you can use the function key to calculate
1. Start in a blank cell. a range. Select MIN (and later MAX) from the
drop-down field in the Insert function window.
2. Type =MEDIAN ( in the formula bar.
All other steps stay the same as for Using the
3. Select a data range for the question you want. function key on page 21.
4. Close the formula by typing ) and then Enter Standard deviation
(Return). A standard deviation demonstrates the degree
Or, you can use the function key . Select to which individual answers vary from the mean.
MEDIAN from the drop-down field in the Insert To calculate the standard deviation for a
function window. All other steps stay the same question in Excel:
as for Using the function key on page 21.
1. Start in a blank cell.
Measures of variability 2. While the blank cell is selected, type
Measures of variability express the spread or =STDEVP( in the formula bar.
variation in responses. Measures of variability 3. Select a data range for the question you want.
include range, standard deviation and variance. 4. Close the formula by typing a ) and then
Range Enter (Return).
A range shows you the minimum and maximum Or, you can use the function key . Select
answers to a question. For example, in the sorted STDEVP from the drop-down field in the Insert
string of numbers 1,1,2,2,3,4,4,5 the range functions window. All other steps stay the same
would be expressed as (1, 5). Ranges are useful as for Using the function key on page 21.
with questions such as timeframes, but not with
Variance
categorical data.
The variance is sometimes used instead of a
standard deviation, and has the same purpose as
What are categorical data? a standard deviation. Variance is expressed as
Categorical data come from a question that (Standard deviation)2.
has a limited number of response items. To calculate the variance in Excel:
For example, from the question Do you smoke? 1. Start in a blank cell.
the responses 1 No or 2 Yes are categorical 2. Type =STDEVP( in the formula bar.
data.
3. Select a data range for the question you want.
4. Close parentheses with a ) to close your data
To create a range in Excel: You will need to
range.
run two separate formulas on your data to obtain
the minimum and maximum answers: 5. Type ^2 to complete the formula, then Enter
(Return).
1. To calculate the minimum for the ques-
tion: Start in a blank cell and type =MIN( in
the formula bar. Then select the data range.
Cross tabulations
Close parentheses with ) to close the formula. Cross tabulations (cross tabs) provide effec-
tive means to compare the results of two survey
2. To calculate the maximum for the ques-
questions. In Excel, use the PivotTable Wizard to
tion: Start in a blank cell and type =MAX( in
create cross tabs.
the formula bar. Then select the data range.
Close parentheses with ) to close the formula. To create cross tabs using PivotTable Wizard:
Click on Data in the menu bar. Then click on
You then have the low and high values for your
Create a PivotTable or PivotChart report.
question. This is a range, which you can write
out as (MIN, MAX). The first window appears (see Figure 32). In this
window, click on Microsoft list or database and
PivotTable. Then click on the Next > button.
24 P R O G R A M D E V E L O P M E N T A N D E V A L U A T I O N
In the second window, the PivotTable Wizard asks you to choose the data you want to use. Begin
with the cursor in the range field, then highlight all of your data or just the data for the questions you
want to analyze. Include question headers, but not the title. Make sure not to include any calculations
that are in your database. After you have selected your data, click Next > (Figure 33).
Figure 33: Select your data
In the third PivotTable Wizard window, choose New worksheet, then click Finish. A blank Pivot
Table will appear.
U S I N G E X C E L F O R A N A L Y Z I N G S U R V E Y Q U E S T I O N N A I R E S 25
Next, determine which questions to To create a cross tab for this example (see
compare: Figure 34):
One question is an independent variable. 1. Select the independent variable header (Q1)
The question to compare is a dependent from the PivotTable Field List, and drag it
variable. to the PivotTable Drop Row Fields Here
box.
For example, you may want to compare the age
of your respondents to their attitudes about 2. Select the dependent variable header (Q2)
smoking. from the PivotTable Field List, and drag it
to the PivotTable Drop Column Fields Here
In this example, age is the independent vari-
box.
able. The independent variable is expected to
affect the dependent variable in this case, 3. Select the dependent variable header (Q2)
the respondents attitude toward smoking. again from the PivotTable Field List, and
drag it to the Drop Data Items Here area in
the blank PivotTable report.
]
Figure 36: Insert descriptive labels
Which do you use?
The two percents most
commonly used in cross
tabs are:
1. % of row
2 % of column
Read why on the next
page.
U S I N G E X C E L F O R A N A L Y Z I N G S U R V E Y Q U E S T I O N N A I R E S 27
* Using this product example is not intended to endorse it over others that may be similar, but rather as a convenience to
readers. Microsoft Excel is a registered trademark of Microsoft Corporation in the United States and other countries.
Using Excel for Analyzing Survey Questionnaires is an independent publication and is not affiliated with, nor has it
been authorized, sponsored, or otherwise approved by Microsoft Corporation.
Copyright 2004 by the Board of Regents of the University of Wisconsin System doing business as the divi-
sion of Cooperative Extension of the University of Wisconsin-Extension. All rights reserved. Send copyright
inquiries to: Manager, Cooperative Extension Publishing, 432 N. Lake St. Rm. 103, Madison WI 53706
Author: Jennifer Leahy, Program Development and Evaluation, University of Wisconsin-Extension. The author
wishes to thank the following UW-Extension faculty and staff for their careful reviews and useful contributions
to this publication: Ellen Taylor-Powell, Susan Anderson, Heather Boyd, Rhonda Lee and Lisa Linfield.
Produced by Cooperative Extension Publishing, University of Wisconsin-Extension.
An EEO/AA employer, University of Wisconsin-Extension Cooperative Extension provides equal opportunities
in employment and programming, including Title IX and Americans with Disabilities Act (ADA) requirements.
This publication is available from your Wisconsin county UW-Extension office or from Cooperative Extension
Publishing. To order, call toll-free: 1-877-WIS-PUBS (877-947-7827)
Or visit our web site: http://cecommerce.uwex.edu