In many reports, there is usually a section that describes the demographics of the sample or population of subjects or clients who are included in the.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
In many reports, there is usually a section that describes the demographics of the sample or population of subjects or clients who are included in the study. This section might include a narrative summary of key statistics, as well as tables and charts displaying the most crucial characteristics of the sample. The activities in this class demonstrate methods for presenting tables and charts that summarize or profile these key characteristics.
The tables that we use to profile demographics will be created as Excel pivot tables. A pivot table is a dynamic tool that that produces tables that are easy to change and manipulate so that a user can look at the data in different ways. While this makes a pivot table very useful for analyzing data, it makes it awkward to chart the data. We will copy the pivot table to a static range of cells containing only formatted text. This will leave the pivot table intact in case we need to work with it.
Once the pivot table has been converted to a static table, we will chart the data in the table using pie charts, bar charts, and column charts.
I have added data for 78 clients of my hypothetical agency in the file ClientDemographics.xls, which can be downloaded from a link on Class Worksheet 6.
I have added data for 78 clients of my hypothetical agency in the file ClientDemographics.xls, which can be downloaded from a link on Class Worksheet 6.
We will change the name of Sheet2 to Client Profile and use this worksheet as the destination for all of our charts and tables for our demographic profile.
We will change the name of Sheet2 to Client Profile and use this worksheet as the destination for all of our charts and tables for our demographic profile.
We will change the name of Sheet3 to PivotTables and use this worksheet for the Excel pivot tables that we create.
We will change the name of Sheet3 to PivotTables and use this worksheet for the Excel pivot tables that we create.
Select PivotTable Report to create a tally for Sex
On step 1 of the PivotTable and PivotChart Wizard, we indicate the source of the data for the report and indicate what type of report we want to produce.
On step 1 of the PivotTable and PivotChart Wizard, we indicate the source of the data for the report and indicate what type of report we want to produce.
Since the data for the table is in a Excel list from which we want to create a PivotTable, we accept the default data source and Kind of report to create.
Since the data for the table is in a Excel list from which we want to create a PivotTable, we accept the default data source and Kind of report to create.
Step 2: verify the location of the data for the table
Excel shows the range as the entire list, including the row for the headers, A1 through D79. Selecting the entire table will enables us to choose to include any field in the list when we are laying out the structure of the table.
Excel shows the range as the entire list, including the row for the headers, A1 through D79. Selecting the entire table will enables us to choose to include any field in the list when we are laying out the structure of the table.
Since the address of the list is the correct data source, click on the Next button to go to Step 3.
Since the address of the list is the correct data source, click on the Next button to go to Step 3.
On step 3 of the PivotTable and PivotChart Wizard, we indicate the destination worksheet for our table and the cell where the upper left corner of the table will be positioned.
On step 3 of the PivotTable and PivotChart Wizard, we indicate the destination worksheet for our table and the cell where the upper left corner of the table will be positioned.
Click on the variable Sex in the Pivot Table Field List as the field that we want to add to the table.
Click on the variable Sex in the Pivot Table Field List as the field that we want to add to the table.
When we finish with the pivot table wizard, Excel creates a layout template on the worksheet that we specified for the report. We create the contents of the pivot table by dropping fields from our lists on the template.
When we finish with the pivot table wizard, Excel creates a layout template on the worksheet that we specified for the report. We create the contents of the pivot table by dropping fields from our lists on the template.
We want to create a frequency table for sex. The first column of the table will contain the categories of sex and the second will contain the number of cases in each category.
We want to create a frequency table for sex. The first column of the table will contain the categories of sex and the second will contain the number of cases in each category.
Adding sex to the table as the row variable - 2
Hold the mouse button down on the icon by the Sex variable, drag the icon to the left and drop it on the section of the table marked Drop Row Fields Here.
Hold the mouse button down on the icon by the Sex variable, drag the icon to the left and drop it on the section of the table marked Drop Row Fields Here.
When Sex as dropped as a row variable, Excel updated the pivot table, using the variable name as a header for the row variable, listing each category as a row in the table, and including grand total as the last row in the table.
When Sex as dropped as a row variable, Excel updated the pivot table, using the variable name as a header for the row variable, listing each category as a row in the table, and including grand total as the last row in the table.
Hold the mouse button down on the icon by the Sex variable, drag the icon to the left and drop it on the section of the table marked Drop Data Items Here.
Hold the mouse button down on the icon by the Sex variable, drag the icon to the left and drop it on the section of the table marked Drop Data Items Here.
When Sex was dropped as a data item, Excel updated the pivot table, and added Count of Sex to the table. The statistic, Count of Sex, is shown in cell A1 in the row above the row variable. The counts for each category are shown in the column to the right of the row categories.
When Sex was dropped as a data item, Excel updated the pivot table, and added Count of Sex to the table. The statistic, Count of Sex, is shown in cell A1 in the row above the row variable. The counts for each category are shown in the column to the right of the row categories.
This is the basic one variable pivot table. It tells us how many subjects were in each category of sex.
This is the basic one variable pivot table. It tells us how many subjects were in each category of sex.
To remove the legend from a chart, right click on the legend and select Clear from the popup menu.
To remove the legend from a chart, right click on the legend and select Clear from the popup menu.
We will label the slices of the pie chart, so we do not need the legend.
We will label the slices of the pie chart, so we do not need the legend.
Adding data labels to the pie slices
Open the Format Data Series dialog box by right clicking on the plot area which contains the pie and selecting the Format Data Series command from the popup menu.
In the Format Data Series dialog box, mark the Category name and Percentage check boxes on the Data Labels tab.
Open the Format Data Series dialog box by right clicking on the plot area which contains the pie and selecting the Format Data Series command from the popup menu.
In the Format Data Series dialog box, mark the Category name and Percentage check boxes on the Data Labels tab.
Format the data labels so that they are displayed in 8 point, Arial Bold.
Format the data labels so that they are displayed in 8 point, Arial Bold.
Since Excel re-scales the chart every time we change a part of it, we will reduce the size of the font for the data labels and see if this results in a better size pie.
Since Excel re-scales the chart every time we change a part of it, we will reduce the size of the font for the data labels and see if this results in a better size pie.
Add a title to the chart
Right click on the chart and select Chart Options from the popup menu.
On the Titles tab, type Breakdown by Sex in the Chart Title text box.
Right click on the chart and select Chart Options from the popup menu.
On the Titles tab, type Breakdown by Sex in the Chart Title text box.
Excel had resized the pie smaller than desired. We can enlarge the plot area by holding the mouse button down over the upper left handle and dragging upward, to the left.
Excel had resized the pie smaller than desired. We can enlarge the plot area by holding the mouse button down over the upper left handle and dragging upward, to the left.
When the size of the plot area is increased, the pie is no longer centered on the chart.
Center the pie on the chart by holding down the mouse button and drag the plot area down and to the left.
When the size of the plot area is increased, the pie is no longer centered on the chart.
Center the pie on the chart by holding down the mouse button and drag the plot area down and to the left.
Format the font for the data labels again
When we resized the plot area, the font for the data labels was made too small by Excel.
When we resized the plot area, the font for the data labels was made too small by Excel.
Format the data labels so that they are displayed in 8 point, Arial Bold.
Format the data labels so that they are displayed in 8 point, Arial Bold.
Add free text to chart to indicate the number of cases
Since the pie chart only shows percentages in each category, we add a text box below the chart title to indicate the total number of cases represented by the pie chart in the format (n = 78).
Since the pie chart only shows percentages in each category, we add a text box below the chart title to indicate the total number of cases represented by the pie chart in the format (n = 78).
Activate the drawing tool, if necessary, and click on the Text Box tool button. Click the insertion point under the title and type (n = 78).
Format the text as 9 point Arial Bold. Center the text box under the title as needed.
Activate the drawing tool, if necessary, and click on the Text Box tool button. Click the insertion point under the title and type (n = 78).
Format the text as 9 point Arial Bold. Center the text box under the title as needed.
Add a discussion text box at the base of the chart
To add a discussion text box for the pie chart, click on the Text Box tool button and click an insertion point at the base of the chart. Type the text: There are a few more boys than girls in the program.
Resize the text box so that it has the same width as the chart. Format the font to 10 point Arial, and fill the background of the text box with White if the grid lines show through the text box.
To add a discussion text box for the pie chart, click on the Text Box tool button and click an insertion point at the base of the chart. Type the text: There are a few more boys than girls in the program.
Resize the text box so that it has the same width as the chart. Format the font to 10 point Arial, and fill the background of the text box with White if the grid lines show through the text box.
The table and chart for the Breakdown by Sex are now complete.
The table and chart for the Breakdown by Sex are now complete.
The next demographic variable that we want to portray with a table and chart is age.
Age can be more complicated to present because there are usually a large range of ages for the people in the data set. To keep the number of pie slices or bars at a manageable number, we tally age ranges instead of individual age values. Though the age range in my list is limited because we are only dealing with children, we will still use age ranges to demonstrate the technique. Our table will use the age ranges: 10 - 11, 12 - 13, 14 - 15, and 16 - 17.
While we could use a pie chart to represent the age breakdown, we will use a bar chart to demonstrate the different technique.
In addition, we will calculate the average age and present it as additional information on the chart.
Select PivotTable Report to create a tally for Age
First, select any cell within the list, e.g. A1.
First, select any cell within the list, e.g. A1.
Second, select the PivotTable and PivotChart Report command from the Data menu to open the PivotTable and PivotChart Wizard dialog box.
Second, select the PivotTable and PivotChart Report command from the Data menu to open the PivotTable and PivotChart Wizard dialog box.
If we are interested in tallying how many cases fall into each category of a variable, we can create a pivot table that gives us this information.
If we are interested in tallying how many cases fall into each category of a variable, we can create a pivot table that gives us this information.
On step 1 of the PivotTable and PivotChart Wizard, we indicate the source of the data for the report and indicate what type of report we want to produce.
On step 1 of the PivotTable and PivotChart Wizard, we indicate the source of the data for the report and indicate what type of report we want to produce.
Since the data for the table is in a Excel list from which we want to create a PivotTable, we accept the default data source and Kind of report to create.
Since the data for the table is in a Excel list from which we want to create a PivotTable, we accept the default data source and Kind of report to create.
Step 2: verify the location of the data for the table
Excel shows the range as the entire list, including the row for the headers, A1 through D79. Selecting the entire table will enables us to choose to include any field in the list when we are laying out the structure of the table.
Excel shows the range as the entire list, including the row for the headers, A1 through D79. Selecting the entire table will enables us to choose to include any field in the list when we are laying out the structure of the table.
Since the address of the list is the correct data source, click on the Next button to go to Step 3.
Since the address of the list is the correct data source, click on the Next button to go to Step 3.
On step 2 of the PivotTable and PivotChart Wizard, we indicate the location of the data for the report.
On step 2 of the PivotTable and PivotChart Wizard, we indicate the location of the data for the report.
Excel created its own copy of the data used for the first pivot table. We can use that source if we choose so we do not make a second internal copy of the data. Making duplicate copies of the data increases the size of the application when save on disk.
Excel created its own copy of the data used for the first pivot table. We can use that source if we choose so we do not make a second internal copy of the data. Making duplicate copies of the data increases the size of the application when save on disk.
Click on the Next button to reuse the source data for pivot table 1 and go to Step 3.
Click on the Next button to reuse the source data for pivot table 1 and go to Step 3.
Since we have only one pivot table source to choose from, the choice is simple. As we include more tables, we will see more choices, but we will continue to select the first pivot table as our choice.
Since we have only one pivot table source to choose from, the choice is simple. As we include more tables, we will see more choices, but we will continue to select the first pivot table as our choice.
Step 3: locate the table on a new worksheet
We want to put all the pivot tables we create on the one worksheet named PivotTables, so we click on the Existing worksheet option button.
We want to put all the pivot tables we create on the one worksheet named PivotTables, so we click on the Existing worksheet option button.
Finally, click on the Finish button to complete the table.
Finally, click on the Finish button to complete the table.
In the text box, we type the worksheet name and cell for the upper left corner of the pivot table, PivotTables!A8.
In the text box, we type the worksheet name and cell for the upper left corner of the pivot table, PivotTables!A8.
On step 3 of the PivotTable and PivotChart Wizard, we indicate the destination worksheet for our table and the cell where the upper left corner of the table will be positioned.
On step 3 of the PivotTable and PivotChart Wizard, we indicate the destination worksheet for our table and the cell where the upper left corner of the table will be positioned.
Adding age to the table as the row variable - 1
Hold the mouse button down on the icon by the Age variable, drag the icon to the left and drop it on the section of the table marked Drop Row Fields Here.
Hold the mouse button down on the icon by the Age variable, drag the icon to the left and drop it on the section of the table marked Drop Row Fields Here.
When we finish with the pivot table wizard, Excel creates a layout template on the worksheet that we specified for the report. We create the contents of the pivot table by dropping fields from our lists on the template.
When we finish with the pivot table wizard, Excel creates a layout template on the worksheet that we specified for the report. We create the contents of the pivot table by dropping fields from our lists on the template.
Adding age to the table as the row variable - 2
When Age was dropped as a row variable, Excel updated the pivot table, using the variable name as a header for the row variable, each category as a row in the table, and including grand total as the last row in the table.
When Age was dropped as a row variable, Excel updated the pivot table, using the variable name as a header for the row variable, each category as a row in the table, and including grand total as the last row in the table.
Hold the mouse button down on the icon by the Age variable, drag the icon to the left and drop it on the section of the table marked Drop Data Items Here.
Hold the mouse button down on the icon by the Age variable, drag the icon to the left and drop it on the section of the table marked Drop Data Items Here.
Since we want a tally of the different categories of age we add age to the table as a data item as well as the row variable.
Since we want a tally of the different categories of age we add age to the table as a data item as well as the row variable.
When Age was dropped as a data item, Excel updated the pivot table, and added Sum of Age to the table instead of Count of Age. When Excel sees that a variable has numerous categories, it assumes you want to sum the values rather than count them.
When Age was dropped as a data item, Excel updated the pivot table, and added Sum of Age to the table instead of Count of Age. When Excel sees that a variable has numerous categories, it assumes you want to sum the values rather than count them.
Since we really do want the count, we select cell A8, which contains Sum of Age, and click on the Field Setting tool button on the PivotTable tool bar.
This will open the PivotTable Field dialog box, which provides options for changing the display of the field.
Since we really do want the count, we select cell A8, which contains Sum of Age, and click on the Field Setting tool button on the PivotTable tool bar.
This will open the PivotTable Field dialog box, which provides options for changing the display of the field.
To reduce the number of categories for age, we will group the ages into two year intervals starting at age 10, the lowest age accepted by my program. The intervals will be: 10-11, 12-13, 14-15, and 16-17.
To reduce the number of categories for age, we will group the ages into two year intervals starting at age 10, the lowest age accepted by my program. The intervals will be: 10-11, 12-13, 14-15, and 16-17.
Excel supports grouping ranges of numeric data provided the ranges all contain the same size intervals.
To open the Grouping dialog box, select Group and Show Detail > Group from the PivotTable drop down menu on the PivotTable toolbar.
Excel supports grouping ranges of numeric data provided the ranges all contain the same size intervals.
To open the Grouping dialog box, select Group and Show Detail > Group from the PivotTable drop down menu on the PivotTable toolbar.
The default grouping for Excel is to put all of the ages in a single group. Since this is not what we want, we will change the default, or auto, values.
The default grouping for Excel is to put all of the ages in a single group. Since this is not what we want, we will change the default, or auto, values. Since I want my first
interval to start at 10, the change the Starting at value to 10.
Since I want my first interval to start at 10, the change the Starting at value to 10.
Since 17 is the upper bound for the last interval I want, there is no need to change the Ending at value.
Since 17 is the upper bound for the last interval I want, there is no need to change the Ending at value.
I want my intervals to contain 2 years each, so I change the By value to 2.
I want my intervals to contain 2 years each, so I change the By value to 2.
When I have made the changes, I click on the OK button to apply them to the table.
When I have made the changes, I click on the OK button to apply them to the table.
We copy the pivot table to the worksheet for tables and charts, converting it from a pivot table to static text along the way.
We copy the pivot table to the worksheet for tables and charts, converting it from a pivot table to static text along the way.
Third, navigate to the Client Profile worksheet and select cell A19.
Third, navigate to the Client Profile worksheet and select cell A19.
Fourth, click on the Paste tool button to put the clipboard copy of the table on the worksheet.
Fourth, click on the Paste tool button to put the clipboard copy of the table on the worksheet.
Add a title and improve formatting of the table
First, increase the width of column A if necessary, so that the letters in Grand Total are fully visible. Do not autofit the column because the title of the first table Breakdown by Sex will cause an autofitted column A to be too wide.
First, increase the width of column A if necessary, so that the letters in Grand Total are fully visible. Do not autofit the column because the title of the first table Breakdown by Sex will cause an autofitted column A to be too wide.
Second, type a title for the table Breakdown by Age into cell A18 above the table, and bold the font for the title.
Second, type a title for the table Breakdown by Age into cell A18 above the table, and bold the font for the title.
We want to make the average age of all children available for possible use in a presentation. We use the Average function to compute the average value for the ages in column B on the Demographics worksheet. We can refer to the entire column B of our list as DemoGraphics!B:B.
We want to make the average age of all children available for possible use in a presentation. We use the Average function to compute the average value for the ages in column B on the Demographics worksheet. We can refer to the entire column B of our list as DemoGraphics!B:B.
First, select cell A25 and type Average Age.
First, select cell A25 and type Average Age. Second, select cell B25 and
type =Average(Demographics!B:B)
When the Enter key is pressed to complete the cell, the average age appears in cell B25.
Second, select cell B25 and type =Average(Demographics!B:B)
When the Enter key is pressed to complete the cell, the average age appears in cell B25.
Reduce the number of decimal places in average age
There are excessive decimal places in the computed average age. With cell B25 selected, click on the Decrease Decimals tool button on the Formatting tool bar enough times to decrease the visible decimal places to one.
There are excessive decimal places in the computed average age. With cell B25 selected, click on the Decrease Decimals tool button on the Formatting tool bar enough times to decrease the visible decimal places to one.
While Excel will calculate percentages for pie charts, we must compute them ourselves for column and bar charts. We first compute the decimal fractions and then format them as percentages.
While Excel will calculate percentages for pie charts, we must compute them ourselves for column and bar charts. We first compute the decimal fractions and then format them as percentages.
Divide the number of clients in each of the age range categories by the total number of clients. In cell C20, enter the formula: =B20/B24.
Divide the number of clients in each of the age range categories by the total number of clients. In cell C20, enter the formula: =B20/B24.
In cell C21, enter the formula: =B21/B24.
In cell C22, enter the formula: =B22/B24.
In cell C23, enter the formula: =B23/B24.
In cell C21, enter the formula: =B21/B24.
In cell C22, enter the formula: =B22/B24.
In cell C23, enter the formula: =B23/B24.
Using autosum function to add up decimal fractions
To add up the decimal fractions for the age ranges, we use the Sum function from the AutoSum tool button.
To add up the decimal fractions for the age ranges, we use the Sum function from the AutoSum tool button.
First, select cell C24 as the destination for the Sum function.
First, select cell C24 as the destination for the Sum function.
The autosum function indicates the range it will sum
The AutoSum function does not complete its work immediately. Rather, it displays the function with the range of cells that it will add up. If the range is incorrect, edit the function in the formula bar.
If the range is correct (as it is in this example), press the Enter key to complete the function.
The AutoSum function does not complete its work immediately. Rather, it displays the function with the range of cells that it will add up. If the range is incorrect, edit the function in the formula bar.
If the range is correct (as it is in this example), press the Enter key to complete the function.
We will add values as data labels to the bars of the chart, so we do not need the legend, which does not really contain any useful information on its own.
We will add values as data labels to the bars of the chart, so we do not need the legend, which does not really contain any useful information on its own.
Adding data labels to the bars
To add data labels, double click on a bar to open the Format Data Series dialog box, and mark the check box for Value on the Data Labels tab.
To add data labels, double click on a bar to open the Format Data Series dialog box, and mark the check box for Value on the Data Labels tab.
Reverse the order of the category (vertical) axis so that the order of the categories matches the data table used to create the chart. The youngest age group should be at the top of the axis, and the oldest age group should be at the bottom of the axis.
Reverse the order of the category (vertical) axis so that the order of the categories matches the data table used to create the chart. The youngest age group should be at the top of the axis, and the oldest age group should be at the bottom of the axis.
To increase the width of the bars, double click on a bar, and click the down arrow on the Gap width spinner on the Options tab until the gap width equals 50. Reducing the gap will increase the width of the bar.
To increase the width of the bars, double click on a bar, and click the down arrow on the Gap width spinner on the Options tab until the gap width equals 50. Reducing the gap will increase the width of the bar.
Add free text to chart to indicate the number of cases
We can improve the information in the chart by including the average age and the number of cases represented by the chart.
We can improve the information in the chart by including the average age and the number of cases represented by the chart.
Activate the drawing tool, if necessary, and click on the Text Box tool button. Click the insertion point under the title and type (average = 14.1, n = 78).
Format the text as 9 point Arial Bold. Center the text box under the title as needed.
Activate the drawing tool, if necessary, and click on the Text Box tool button. Click the insertion point under the title and type (average = 14.1, n = 78).
Format the text as 9 point Arial Bold. Center the text box under the title as needed.
Add a discussion text box at the base of the chart
To add a discussion text box for the bar chart, click on the Text Box tool button and click an insertion point at the base of the chart. Type the text: About two-thirds of the children were age 14 or older.
Resize the text box so that it has the same width as the chart. Format the font to 10 point Arial, and fill the background of the text box with White if the grid lines show through the text box.
To add a discussion text box for the bar chart, click on the Text Box tool button and click an insertion point at the base of the chart. Type the text: About two-thirds of the children were age 14 or older.
Resize the text box so that it has the same width as the chart. Format the font to 10 point Arial, and fill the background of the text box with White if the grid lines show through the text box.
The table and chart for the Breakdown by Sex are now complete.
The table and chart for the Breakdown by Sex are now complete.