{"id":97,"date":"2019-01-04T23:33:57","date_gmt":"2019-01-04T23:33:57","guid":{"rendered":"http:\/\/miriamposner.com\/classes\/dh201w21\/?page_id=97"},"modified":"2019-01-21T23:49:14","modified_gmt":"2019-01-21T23:49:14","slug":"make-a-pivot-table-with-excel","status":"publish","type":"page","link":"http:\/\/miriamposner.com\/classes\/dh201w21\/tutorials-guides\/data-cleaning-and-manipulation\/make-a-pivot-table-with-excel\/","title":{"rendered":"Make a pivot table with Excel"},"content":{"rendered":"\n<p>A&nbsp;<strong>pivot table<\/strong>&nbsp;summarizes 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 learn which types of grants were awarded in Iowa in 2015, and next to understand the correlation of city with grant type.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. See what happens without a pivot table (1)<\/h3>\n\n\n\n<p>When a person investigates column C, &#8220;Grant Type,&#8221; they&#8217;ll tend to understand that the data is categorical; that is, the data is divided into groups. Therefore, a meaningful data visualization should probably show how many individual records are in each group.<\/p>\n\n\n\n<p>Yet Excel doesn&#8217;t immediately understand this. You can see what I mean by first selecting the entire column C, &#8220;Grant Type.&#8221; (You can select the column by using your cursor to press the &#8220;C&#8221; above the words &#8220;Grant Type.&#8221;)<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"632\" height=\"680\" src=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-2.57.42-PM.png\" alt=\"\" class=\"wp-image-292\" srcset=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-2.57.42-PM.png 632w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-2.57.42-PM-279x300.png 279w\" sizes=\"auto, (max-width: 632px) 100vw, 632px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mce_3\">2. See what happens without a pivot table (2)<\/h3>\n\n\n\n<p>Now click on the <strong>Insert<\/strong> tab within the Excel window. From the array of chart types, select the column chart and then select <strong>2D&nbsp;Column<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"733\" src=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-2.59.56-PM-1024x733.png\" alt=\"\" class=\"wp-image-293\" srcset=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-2.59.56-PM-1024x733.png 1024w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-2.59.56-PM-300x215.png 300w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-2.59.56-PM-768x550.png 768w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-2.59.56-PM.png 1452w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"mce_3\">3. See what happens without a pivot table (3)<\/h3>\n\n\n\n<p>Not really what we wanted, is it? Excel is trying to find numeric values for each of these grant types; it doesn&#8217;t understand that the values are categorical. <\/p>\n\n\n\n<p>Please delete the graph you just created by clicking on it and then pressing the <strong>delete<\/strong> key. We&#8217;ll start again, this time building a pivot table.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"924\" height=\"618\" src=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.02.04-PM.png\" alt=\"\" class=\"wp-image-294\" srcset=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.02.04-PM.png 924w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.02.04-PM-300x201.png 300w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.02.04-PM-768x514.png 768w\" sizes=\"auto, (max-width: 924px) 100vw, 924px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">4. Pick a column<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"632\" height=\"680\" src=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-2.57.42-PM-1.png\" alt=\"\" class=\"wp-image-295\" srcset=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-2.57.42-PM-1.png 632w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-2.57.42-PM-1-279x300.png 279w\" sizes=\"auto, (max-width: 632px) 100vw, 632px\" \/><\/figure>\n\n\n\n<p>To start with, we\u2019ll look at one variable (Grant Type) in isolation. Use your mouse to click on Column C.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. Turn your column into a pivot table (1)<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"739\" src=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.07.28-PM-1024x739.png\" alt=\"\" class=\"wp-image-296\" srcset=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.07.28-PM-1024x739.png 1024w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.07.28-PM-300x216.png 300w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.07.28-PM-768x554.png 768w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.07.28-PM.png 1322w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>From the&nbsp;<strong>Data<\/strong>&nbsp;menu in the TOP TOOLBAR, select&nbsp;<strong>Summarize with<\/strong> <strong>PivotTable.&nbsp;<\/strong>In the window that pops up, leave the options as they are and click&nbsp;<strong>OK<\/strong>. Excel will open your PivotTable in a new worksheet, within the same Excel file.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. Turn your column into a pivot table (2)<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"816\" src=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.10.35-PM-1024x816.png\" alt=\"\" class=\"wp-image-297\" srcset=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.10.35-PM-1024x816.png 1024w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.10.35-PM-300x239.png 300w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.10.35-PM-768x612.png 768w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.10.35-PM.png 1518w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Excel will open a new worksheet and you\u2019ll see a blank table, along with the&nbsp;<strong>PivotTable Builder<\/strong>. The PivotTable Builder allows you to select which values you\u2019d like to summarize. <\/p>\n\n\n\n<p>In all honesty, this is the part of building a pivot table that confuses everyone, including me. It&#8217;s helpful to visualize what a useful table summarizing grant types would look like. Each <em>row<\/em> would be a type of grant. For each type of grant, we&#8217;d see a <em>value<\/em>; that is, the number of each.<\/p>\n\n\n\n<p>Click on the word&nbsp;<strong>Grant&nbsp;Type<\/strong>&nbsp;on the PivotTable Builder and drag it, first into the&nbsp;<strong>Rows<\/strong>&nbsp;area and next into the&nbsp;<strong>Values<\/strong>&nbsp;area. Hey, look, the grant types are summarized for you!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">7. Turn your pivot table into a chart<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"558\" src=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.23.47-PM-1-1024x558.png\" alt=\"\" class=\"wp-image-299\" srcset=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.23.47-PM-1-1024x558.png 1024w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.23.47-PM-1-300x163.png 300w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.23.47-PM-1-768x418.png 768w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.23.47-PM-1.png 1494w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>From the\u00a0<strong>PivotTable\u00a0Analyze<\/strong>\u00a0tab, select\u00a0<strong>PivotChart<\/strong>. This selects a chart for you. Now you have a chart! <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">8. Make a pivot table that compares two values<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"566\" src=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.34.43-PM-1024x566.png\" alt=\"\" class=\"wp-image-300\" srcset=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.34.43-PM-1024x566.png 1024w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.34.43-PM-300x166.png 300w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.34.43-PM-768x424.png 768w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.34.43-PM-1568x866.png 1568w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.34.43-PM.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>We actually have multiple columns in our dataset, so why not see how two of them correlate with each other? Follow steps four and five above, except this time, in step one, select both columns C and D (<strong>Grant Type<\/strong> and <strong>County<\/strong>). When you get to the\u00a0<strong>PivotTable Builder<\/strong>, select the options indicated in the image above. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">9. Make a chart that compares two values (1)<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"799\" height=\"1024\" src=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.38.28-PM-799x1024.png\" alt=\"\" class=\"wp-image-301\" srcset=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.38.28-PM-799x1024.png 799w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.38.28-PM-234x300.png 234w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.38.28-PM-768x984.png 768w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.38.28-PM.png 1088w\" sizes=\"auto, (max-width: 799px) 100vw, 799px\" \/><\/figure>\n\n\n\n<p>Instead of letting Excel pick our chart for us, let&#8217;s build a stacked bar chart. Select the cells indicated in the image above. (That is, select all the cells that contain values, except the <strong>Grand Total<\/strong> row.) Then click on the\u00a0<strong>Insert<\/strong>\u00a0tab within the Excel window.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">10. Make a chart that compares two values (2)<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"928\" src=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.43.12-PM-1024x928.png\" alt=\"\" class=\"wp-image-303\" srcset=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.43.12-PM-1024x928.png 1024w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.43.12-PM-300x272.png 300w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.43.12-PM-768x696.png 768w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.43.12-PM.png 1048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>From the\u00a0<strong>Charts<\/strong>\u00a0options, select\u00a0<strong>Column<\/strong>, and then\u00a0<strong>2DStacked Bar<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">11. You did it!<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"898\" height=\"942\" src=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.40.58-PM.png\" alt=\"\" class=\"wp-image-302\" srcset=\"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.40.58-PM.png 898w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.40.58-PM-286x300.png 286w, http:\/\/miriamposner.com\/classes\/dh201w21\/wp-content\/uploads\/sites\/18\/2019\/01\/Screen-Shot-2019-01-21-at-3.40.58-PM-768x806.png 768w\" sizes=\"auto, (max-width: 898px) 100vw, 898px\" \/><\/figure>\n\n\n\n<p> Now you can see not only how many grants each county has received, but how many of each kind!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A&nbsp;pivot table&nbsp;summarizes 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&hellip; <a class=\"more-link\" href=\"http:\/\/miriamposner.com\/classes\/dh201w21\/tutorials-guides\/data-cleaning-and-manipulation\/make-a-pivot-table-with-excel\/\">Continue reading <span class=\"screen-reader-text\">Make a pivot table with Excel<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":95,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_eb_attr":"","footnotes":""},"class_list":["post-97","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-json\/wp\/v2\/pages\/97","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-json\/wp\/v2\/comments?post=97"}],"version-history":[{"count":0,"href":"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-json\/wp\/v2\/pages\/97\/revisions"}],"up":[{"embeddable":true,"href":"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-json\/wp\/v2\/pages\/95"}],"wp:attachment":[{"href":"http:\/\/miriamposner.com\/classes\/dh201w21\/wp-json\/wp\/v2\/media?parent=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}