{"id":2811,"date":"2017-11-15T11:36:19","date_gmt":"2017-11-15T19:36:19","guid":{"rendered":"http:\/\/miriamposner.com\/classes\/dh101f17\/?page_id=2811"},"modified":"2017-11-15T11:36:19","modified_gmt":"2017-11-15T19:36:19","slug":"summarize-values-with-excel","status":"publish","type":"page","link":"https:\/\/miriamposner.com\/classes\/dh101f17\/tutorials-guides\/data-visualization\/summarize-values-with-excel\/","title":{"rendered":"Summarize values with Excel"},"content":{"rendered":"<div class=\"LessonSummary\">\n<p>In this exercise, we\u2019ll look at ways to deal with\u00a0<em>nominal values<\/em>\u00a0in our data. Remember, nominal data is categorized with labels, but those labels don\u2019t correspond to quantitative values. So unlike other values \u2014 like \u201cnumber of minutes\u201d or \u201cage\u201d \u2014 they can\u2019t be directly charted as numerical values. Instead, we first have to\u00a0<em>count\u00a0<\/em>the values. Then we can plot the number of records in each category.<\/p>\n<p>In Excel, a<strong>\u00a0pivot table<\/strong>\u00a0summarizes data values. For example, given a list of students\u2019 majors, a pivot table can tell us how many students have declared an English major, a communication major, and so on. Here, we\u2019ll use a pivot table first to understand the majors represented in our class, and next to understand the correlation of major with gender in our class.<\/p>\n<p>Open this\u00a0spreadsheet in Excel and then follow the steps below to build a chart of your data.<\/p>\n<p><em>Note: If you\u2019re getting this error: \u201dThis command requires at least two rows of source data. You cannot use the command on a selection in only one row,\u201d please scroll to the end of this tutorial for a fix.<\/em><\/p>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">1. Pick a column<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445452093696.png\" alt=\"media_1445452093696.png\" width=\"301\" height=\"410\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>To start with, we\u2019ll look at one variable (major) in isolation. Use your mouse to click on Column B.<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">2. Turn your column into a pivot table (1)<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445452151918.png\" alt=\"media_1445452151918.png\" width=\"540\" height=\"385\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>From the\u00a0<strong>Data<\/strong>\u00a0menu, select\u00a0<strong>PivotTable.\u00a0<\/strong>In the window that pops up, leave the options as they are and click\u00a0<strong>OK<\/strong>.<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">3. Turn your column into a pivot table (2)<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445452428630.png\" alt=\"media_1445452428630.png\" width=\"540\" height=\"441\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>Excel will open a new worksheet and you\u2019ll see a blank table, along with the<strong>PivotTable Builder<\/strong>. The PivotTable Builder allows you to select which values you\u2019d like to summarize. In this case, we selected\u00a0<strong>Majors<\/strong>\u00a0in the previous step. Click on the word\u00a0<strong>Majors<\/strong>\u00a0on the PivotTable Builder and drag it, first into the\u00a0<strong>Row Labels<\/strong>\u00a0area and next into the\u00a0<strong>Values<\/strong>\u00a0area. Hey, look, the majors are summarized for you!<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">4. Turn your pivot table into a chart (1)<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445452553307.png\" alt=\"media_1445452553307.png\" width=\"415\" height=\"614\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>Now that your majors are summarized, it\u2019s pretty easy to turn them into a chart. Use your mouse to select the cells indicated in the image above. Then click on the\u00a0<strong>Charts<\/strong>\u00a0tab.<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">5. Turn your pivot table into a chart (2)<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445452784616.png\" alt=\"media_1445452784616.png\" width=\"540\" height=\"404\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>From the\u00a0<strong>Chart<\/strong>\u00a0tab, select\u00a0<strong>Bar<\/strong>\u00a0and then\u00a0<strong>Stacked Bar<\/strong>. Check it out, you have a chart! Play with the coloring and formatting options to make the chart look the way you want.<\/p>\n<p>Remember, the more variation you introduce to your graph (e.g., color, shape, size), the harder it is to understand. So if you add an element, be sure it\u2019s meaningful.<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">6. Make a pivot table that compares two values<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445453044164.png\" alt=\"media_1445453044164.png\" width=\"540\" height=\"308\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>We actually have two columns in our dataset, so why not see how they correlate with each other? Follow steps one and two above, except this time, in step one, select both columns A and B. When you get to the\u00a0<strong>PivotTable Builder<\/strong>, select the options indicated in the image above. (Tip: For \u201cRow Labels,\u201d it\u2019s generally good to select the column that has more values in it, and for \u201cColumn Labels,\u201d that column that has fewer values.)<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">7. Make a chart that compares two values (1)<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445453375963.png\" alt=\"media_1445453375963.png\" width=\"540\" height=\"555\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>Select the cells indicated in the image above. Then click on the\u00a0<strong>Charts<\/strong>\u00a0tab, just as you did in Step 4.<\/p>\n<\/div>\n<\/div>\n<div class=\"LessonStep top\">\n<h3 class=\"StepTitle\">8. Make a chart that compares two values (2)<\/h3>\n<div class=\"StepImage\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/miriamposner.com\/dh101f15\/wp-content\/uploads\/2015\/10\/media_1445453481904.png\" alt=\"media_1445453481904.png\" width=\"447\" height=\"350\" \/><\/div>\n<div class=\"StepInstructions\">\n<p>From the\u00a0<strong>Charts<\/strong>\u00a0tab, select\u00a0<strong>Bar<\/strong>, and then\u00a0<strong>Stacked Bar<\/strong>. Now you can see not only how many students have declared which major, but what proportion of these majors are male versus female!<\/p>\n<\/div>\n<\/div>\n<div id=\"wrapper\">\n<div id=\"header-row\">\n<div id=\"header-left\">\n<div id=\"header-left-content\">\n<div class=\"align-bottom\">\n<h1 class=\"clarify-article-title\"><em>If you\u2019re having trouble selecting data for your pivot table\u2026<\/em><\/h1>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"clarify-article-content\">\n<div class=\"clarify-article-description\">\n<p>A couple people have been getting the following error when they attempt to build a pivot table after selecting multiple columns: \u201c<strong>This command requires at least two rows of source data. You cannot use the command on a selection in only one row.<\/strong>\u201d I\u2019m not sure exactly what is causing the error, but the following fix seems to take care of it.<\/p>\n<\/div>\n<div class=\"clarify-steps-container\">\n<div id=\"clarify-step-1\" class=\"clarify-step-container\">\n<h2 class=\"clarify-step-title\">Instead of selecting your columns and then creating a pivot table, do it the other way around<\/h2>\n<div class=\"clarify-step-instructions\">\n<p>Start by clicking on\u00a0<strong>Insert<\/strong>\u00a0and then\u00a0<strong>Pivot Table<\/strong>. Then, with your cursor in the\u00a0<strong>Table\/Range<\/strong>\u00a0text box, click on the first column you want in your pivot table. Then, hold down\u00a0<strong>shift<\/strong>\u00a0and click on the second column. When you\u2019re done, just click\u00a0<strong>OK<\/strong>, and your pivot table should work!<\/p>\n<\/div>\n<div class=\"clarify-step-image-wrapper\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><a href=\"http:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/09\/instead-of-selecting-your-columns-and-then-creating-a-pivot-table-do-it-the-other-way-around.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1610\" src=\"http:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/09\/instead-of-selecting-your-columns-and-then-creating-a-pivot-table-do-it-the-other-way-around.png\" sizes=\"auto, (max-width: 754px) 85vw, 754px\" srcset=\"http:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/09\/instead-of-selecting-your-columns-and-then-creating-a-pivot-table-do-it-the-other-way-around.png 754w, http:\/\/miriamposner.com\/classes\/dh101f16\/wp-content\/uploads\/sites\/5\/2016\/09\/instead-of-selecting-your-columns-and-then-creating-a-pivot-table-do-it-the-other-way-around-300x166.png 300w\" alt=\"instead-of-selecting-your-columns-and-then-creating-a-pivot-table-do-it-the-other-way-around\" width=\"754\" height=\"417\" \/><\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this exercise, we\u2019ll look at ways to deal with\u00a0nominal values\u00a0in our data. Remember, nominal data is categorized with labels,<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":137,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_eb_attr":"","footnotes":""},"class_list":["post-2811","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/pages\/2811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/comments?post=2811"}],"version-history":[{"count":0,"href":"https:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/pages\/2811\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/pages\/137"}],"wp:attachment":[{"href":"https:\/\/miriamposner.com\/classes\/dh101f17\/wp-json\/wp\/v2\/media?parent=2811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}