{"id":213,"date":"2023-10-20T15:23:44","date_gmt":"2023-10-20T14:23:44","guid":{"rendered":"https:\/\/jayexcelblog.com\/?p=213"},"modified":"2023-11-03T16:39:10","modified_gmt":"2023-11-03T16:39:10","slug":"pivot-tables-a-how-to-guide","status":"publish","type":"post","link":"https:\/\/jayexcelblog.com\/index.php\/2023\/10\/20\/pivot-tables-a-how-to-guide\/","title":{"rendered":"Pivot Tables \u2013 A How-To Guide"},"content":{"rendered":"\n<p>Hey everyone!<\/p>\n\n\n\n<p>Welcome to my first blog post ever \ud83d\ude0a<\/p>\n\n\n\n<p>Today I\u2019m going to dive into everyone\u2019s favorite Excel feature \u2013 PivotTables!<\/p>\n\n\n\n<p>If you\u2019re a beginning Excel user, don\u2019t be scared! I\u2019ll show you how PivotTables are a lot simpler than you probably think.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><u>What is a PivotTable?<\/u><\/strong><\/h3>\n\n\n\n<p>Let\u2019s start with a basic question \u2013 what is this mysterious \u201cPivotTable\u201d thing?<\/p>\n\n\n\n<p>Microsoft\u2019s definition:<\/p>\n\n\n\n<p><em>A PivotTable is a powerful tool to calculate, summarize, and analyze data that lets you see comparisons, patterns, and trends in your data.<\/em><\/p>\n\n\n\n<p>That\u2019s a pretty solid definition, but if I had to make it more concise:<\/p>\n\n\n\n<p>PivotTables let you <em><u>organize your data into groups<\/u><\/em>.<\/p>\n\n\n\n<p>This is easiest to demonstrate with an example:<\/p>\n\n\n\n<p>Say we have some very simple product sales data, like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"768\" height=\"159\" src=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Data-Image-1.png\" alt=\"\" class=\"wp-image-214\" srcset=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Data-Image-1.png 768w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Data-Image-1-300x62.png 300w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure>\n\n\n\n<p>Download the file here:<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-ebdb971c-d036-48d1-9d82-574a67e71858\" href=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/11\/Pivot-table-post-sample-data.xlsx\">Pivot-table-post-sample-data<\/a><a href=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/11\/Pivot-table-post-sample-data.xlsx\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-ebdb971c-d036-48d1-9d82-574a67e71858\">Download<\/a><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>Just looking at the data, you can probably come up with a few different questions to investigate:<\/p>\n\n\n\n<ul>\n<li>How have Total Sales trended over the past few months?<\/li>\n<\/ul>\n\n\n\n<ul>\n<li>Which country has the most sales?<\/li>\n<\/ul>\n\n\n\n<ul>\n<li>What is the average Price by Product Category?<\/li>\n<\/ul>\n\n\n\n<p>All of these can be answered in a straightforward way with PivotTables, by creating groups and then performing calculations (such as sum, average, etc.) across the groups.<\/p>\n\n\n\n<p>Let\u2019s dive in:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong><u>Step 1 \u2013 Inserting the PivotTable<\/u><\/strong><\/h3>\n\n\n\n<p>Highlight your data (or Ctrl + A), go to the \u201cInsert\u201d tab on the ribbon and click \u201cPivotTable\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"986\" height=\"453\" src=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Insert-PT-Image-1.png\" alt=\"\" class=\"wp-image-215\" srcset=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Insert-PT-Image-1.png 986w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Insert-PT-Image-1-300x138.png 300w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Insert-PT-Image-1-768x353.png 768w\" sizes=\"(max-width: 986px) 100vw, 986px\" \/><\/figure>\n\n\n\n<p>A dialog box will appear:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"334\" height=\"210\" src=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Insert-PT-Image-2.png\" alt=\"\" class=\"wp-image-216\" style=\"aspect-ratio:1.5904761904761904;width:276px;height:auto\" srcset=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Insert-PT-Image-2.png 334w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Insert-PT-Image-2-300x189.png 300w\" sizes=\"(max-width: 334px) 100vw, 334px\" \/><\/figure><\/div>\n\n\n<p>Since I\u2019ve formatted my data as a table, I can simply select the Table by its name (Table1 in this case).<\/p>\n\n\n\n<p>I\u2019ll insert the PivotTable in a new sheet, but you can also put it in the same sheet if you\u2019d like.<\/p>\n\n\n\n<p>Click \u201cOK\u201d, and you should get something like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"982\" height=\"366\" src=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Blank-PT-Image.png\" alt=\"\" class=\"wp-image-217\" srcset=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Blank-PT-Image.png 982w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Blank-PT-Image-300x112.png 300w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Blank-PT-Image-768x286.png 768w\" sizes=\"(max-width: 982px) 100vw, 982px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"text-decoration: underline;\">Step 2 &#8211; Using the PivotTable to Group &amp; Aggregate<\/span><\/h3>\n\n\n\n<p>So now we need to decide two things:<\/p>\n\n\n\n<ol type=\"1\">\n<li>How we want to group the data (by Category, Country, Date?)<\/li>\n<\/ol>\n\n\n\n<p class=\"has-text-align-center\"><strong>The groups will go in the \u201cRows\u201d and\/or \u201cColumns\u201d areas.<\/strong><\/p>\n\n\n\n<p>2. How we want to aggregate the data (sum, average, etc.)<\/p>\n\n\n\n<p class=\"has-text-align-center\"><strong>The value we want to aggregate will go in \u201cValues\u201d.<\/strong><\/p>\n\n\n\n<p>Let\u2019s start by breaking down the first question from earlier: How have Total Sales trended over the past few months?<\/p>\n\n\n\n<p>So we know we\u2019re going to be measuring <em>Total Sales<\/em>, so let\u2019s drag that into the \u201cValues\u201d area:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"999\" height=\"367\" src=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Total-Sales-PT-Image.png\" alt=\"\" class=\"wp-image-218\" srcset=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Total-Sales-PT-Image.png 999w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Total-Sales-PT-Image-300x110.png 300w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Total-Sales-PT-Image-768x282.png 768w\" sizes=\"(max-width: 999px) 100vw, 999px\" \/><\/figure>\n\n\n\n<p>Nice! Notice that Excel defaulted to using \u201cSum\u201d for the aggregation, which is perfect in this case because we want to know <em>Total Sales<\/em>.<\/p>\n\n\n\n<p>So we\u2019ve already created our aggregation, now we need to break the sum down into groups.<\/p>\n\n\n\n<p>We want to know sales <em>over the last few months<\/em>, so this means we need to group the data by Order Date.<\/p>\n\n\n\n<p>Let\u2019s drag Order Date into \u201cRows\u201d:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"936\" height=\"346\" src=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Total-Sales-by-Date-PT-Image-1.png\" alt=\"\" class=\"wp-image-220\" srcset=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Total-Sales-by-Date-PT-Image-1.png 936w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Total-Sales-by-Date-PT-Image-1-300x111.png 300w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Total-Sales-by-Date-PT-Image-1-768x284.png 768w\" sizes=\"(max-width: 936px) 100vw, 936px\" \/><\/figure>\n\n\n\n<p>Awesome!<\/p>\n\n\n\n<p>Notice how Excel automatically converted our date into a \u201cdate hierarchy\u201d (Month, Day, etc.). If you expand the \u2018+\u2019, you can see the days underneath the month.<\/p>\n\n\n\n<p>Ok, so we answered our question, but let\u2019s make it easier to analyze by inserting a chart.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span style=\"text-decoration: underline;\">Step 3 &#8211; Inserting a PivotChart<\/span><\/h3>\n\n\n\n<p>Under \u201cPivotTable Analyze\u201d on the toolbar, click \u201cPivotChart\u201d:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"265\" src=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/PivotChart-Image-1024x265.png\" alt=\"\" class=\"wp-image-221\" srcset=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/PivotChart-Image-1024x265.png 1024w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/PivotChart-Image-300x78.png 300w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/PivotChart-Image-768x198.png 768w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/PivotChart-Image-1536x397.png 1536w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/PivotChart-Image-2048x529.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Since we want to see a trend over time, let&#8217;s choose a line chart.<\/p>\n\n\n\n<p>Click &#8220;OK&#8221;:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"651\" height=\"607\" src=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Line-Chart-Insert.png\" alt=\"\" class=\"wp-image-222\" style=\"aspect-ratio:1.0724876441515652;width:401px;height:auto\" srcset=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Line-Chart-Insert.png 651w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/Line-Chart-Insert-300x280.png 300w\" sizes=\"(max-width: 651px) 100vw, 651px\" \/><\/figure><\/div>\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"563\" src=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/PivotChart-End-Result-1024x563.png\" alt=\"\" class=\"wp-image-223\" srcset=\"https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/PivotChart-End-Result-1024x563.png 1024w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/PivotChart-End-Result-300x165.png 300w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/PivotChart-End-Result-768x422.png 768w, https:\/\/jayexcelblog.com\/wp-content\/uploads\/2023\/10\/PivotChart-End-Result.png 1365w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Pretty cool!<\/p>\n\n\n\n<p>Now we can see how our Sales data is trending over time.<\/p>\n\n\n\n<p>That&#8217;s it for today, &#8217;til next time! <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey everyone! Welcome to my first blog post ever \ud83d\ude0a Today I\u2019m going to dive into everyone\u2019s favorite Excel feature \u2013 PivotTables! If you\u2019re a beginning Excel user, don\u2019t be scared! I\u2019ll show you how PivotTables are a lot simpler than you probably think. What is a PivotTable? Let\u2019s start with a basic question \u2013&hellip;&nbsp;<a href=\"https:\/\/jayexcelblog.com\/index.php\/2023\/10\/20\/pivot-tables-a-how-to-guide\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Pivot Tables \u2013 A How-To Guide<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","_themeisle_gutenberg_block_has_review":false,"_ti_tpc_template_sync":false,"_ti_tpc_template_id":"","footnotes":""},"categories":[1],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/jayexcelblog.com\/index.php\/wp-json\/wp\/v2\/posts\/213"}],"collection":[{"href":"https:\/\/jayexcelblog.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jayexcelblog.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jayexcelblog.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jayexcelblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=213"}],"version-history":[{"count":3,"href":"https:\/\/jayexcelblog.com\/index.php\/wp-json\/wp\/v2\/posts\/213\/revisions"}],"predecessor-version":[{"id":284,"href":"https:\/\/jayexcelblog.com\/index.php\/wp-json\/wp\/v2\/posts\/213\/revisions\/284"}],"wp:attachment":[{"href":"https:\/\/jayexcelblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jayexcelblog.com\/index.php\/wp-json\/wp\/v2\/categories?post=213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jayexcelblog.com\/index.php\/wp-json\/wp\/v2\/tags?post=213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}