Excel Pivot Tables Tutorial : What is a Pivot Table and How to Make one

Share

Facebook
Twitter
LinkedIn

Excel pivot tables are very useful and powerful feature of MS Excel. They are be used to create instant summaries, reports and data analysis from your raw data

In this page, learn all about how to create an Excel pivot table and customize it.

Table of Contents

What are Excel Pivot Tables?

A pivot table turns your data into report format. Here is a sample Pivot table from sales data, showing total sales by region.

Example of an Excel Pivot Table

How to create a Pivot Table?

We will use 2019 sales data of a fictional company. This data contains 466 rows of sales information in columns – Month, Salesman, Region, Product, No.  Customers, Net Sales, Profit / Loss. Here is a preview of our data.

Sample data - Pivot tables in Excel

Download the sample data & example pivot tables here.

To create a pivot table showing totals sales by region, follow these steps.

  1. Select any cell in the data.
  2. Go to Insert ribbon and click “Pivot Table” button.
    Insert Pivot Table button - Excel ribbon
  3.  Click ok on the next screen.
    Create Pivot Table dialog
  4. You will be taken a new spreadsheet with blank Pivot Table canvas.  Here, using the Pivot Table Fields panel set “Regions” field to row label area, “Products” to “Filter” area and “Net Sales” to values area. See below illustration.
    how to use pivot table fields - setting up a pivot table

Your pivot table will be ready. We can see that “West” is our best region. This is why Pivot tables are easy for finding answers to common business questions.

Two dimensional Pivots - Row & Column fields

You can add fields to both “Row” and “Column” label area of a pivot. Such Pivot Tables are normally called two dimensional pivots. Here is a demo of a two dimensional pivot table showing Total Sales by Region & Sales Person.

Two dimensional pivot - demo

Multi-dimensional Pivots - Row & Column fields

You can also add more than one item to “Row” or “Column” label area. This creates a multi-dimensional Pivot Report. Here is one such pivot report showing total sales by Region, Sales Person & Product for selected months.

Example Pivot Report - A very detailed Pivot Table with sub-totals and totals

 

How to format Pivot Table values?

By default, numbers in Pivot Tables tend to just look like zip codes, without any proper formatting. This is easy to fix though. Simply right click on the values and use “Value Field Settings” to set up the formatting. To set currency formatting for our Total sales by region Pivot Report, 

  1. Go to value field settings
  2. Click on Number Format button
  3. Set up the formatting to “Currency”
  4. Done.

See this illustration.

How to currency format pivot table values

 

Sorting in Excel Pivot Tables

You can easily sort pivot report by ascending or descending order of the value. To do this, just right click on the value, select Sort > and specify the order.

Here is an example of sorted pivot report of Number of customers by Sales person.

Sorting a pivot table in descending order of sales

Filtering Excel Pivot Tables

You are looking at Regional total sales and want to know what the total is for just “RapidZoo” product. You can do this by filtering the pivot table. Excel offers two powerful ways to filter Pivot Tables

  1. Report filters
  2. Slicers

Both methods are illustrated below. Read on to learn how to use them.

Filtering an excel pivot table - two methods

Filtering with Report Filters

Report filter is a great way to restrict the data that is flowing to your pivot. To set them up, just add the field to “Filters” area in the fields panel. Now, using the filter button next to “Product”, select the product you want.

Here is a quick demo of report filters in action.

Report filter demo

Filtering with Slicers

There are a ton of cool features in Excel Pivot Tables, but slicers are hands-down the best feature. At-least, that is what I think. They make filtering and ad-hoc data analysis a breeze.

A slicer is a visual filter. You can add a slicer on any field by right clicking on it from the fields panel. See the illustration “Adding filters to a pivot report” from above. 

Once you have a slicer on Product, simply click on any product name to see the report for that. 

Here is a quick demo of Pivot Table with slicers.

Filtering a pivot table with slicer - demo

Other kinds of filtering - Value & Label Filters

Apart from report filters & Slicers, Pivot Tables also allow you to filter by a field or value. 

Field or Label Filter: If you don’t want to see “Middle” region in a row label area, just click on the filter button next to “Row Labels” and uncheck the region. This type of filtering is called Label Filtering.

Value Filter: If you want to see just the top 2 regions by total sales, then you need a value filter. Simply go to filter button next to row labels and using value filters, apply a top 10 filter but set it to top 2 values by “Sum of net sales.”

Changing Calculations in Pivot Tables

The default calculation in Pivot Tables is SUM for number fields and COUNT for all others. But you can also customize the calculation easily. Just right click on the value field and choose different type of summary from right click menu.

Changing from SUM to AVERAGE in a Pivot Table

Here is a quick illustration of how to change calculation type from “SUM” to “AVERAGE”.

how to change pivot table calculations

Pivot Table Layouts & Colors

By default, Excel Pivot Tables are in compact layout. This means, if you add multiple fields to row label area, they will all be shown in same column, with indentation.

You can change the layout of a pivot table to other formats too. 

  • Compact form (default)
  • Outline form
  • Tabular form

You can change the layout from Pivot Table Design ribbon.

Pivot Table layout options

Here is an example of same Pivot Table in both Compact and Tabular layouts. 

Compact vs. Tabular Layouts for Pivot Tables in Excel

Styling & colors of Excel Pivot Tables

You can apply any formatting to the pivot tables. MS Excel has some very good pivot table styles. Just select pivot table cells, go to Pivot Table Design ribbon. See below image to understand various options available.

Pivot table design options

Visualizing with Pivot Charts

You can use Pivot Charts to visualize the same information in a graphic format. Here is a sample Pivot Chart of Net Sales by Region & Product.

Excel Pivot Chart - Example

Steps for creating a Pivot Chart:

  1. Select any cell in the Pivot Table.
  2. Click on Insert > Chart or Analyze > Pivot Chart button.
  3. Insert the type of chart you want.
  4. You will get a Pivot Chart.

Interactive Pivot Chart with Slicers

Slicers make it incredibly easy to create interactive charts. Once you have a regular Pivot Chart, simply add a slicer to it (right click on the field in “Pivot Table Fields” area and select “Add as Slicer”). You now have an interactive Pivot Chart.

Here is a demo of interactive Pivot Chart. 

interactive pivot chart with slicers

Updating Pivot Tables (Refresh)

Whenever you have new data, just use “Refresh” button to update your Pivot Tables. You can find this button in multiple places.

  • Data ribbon
  • Pivot Table Analyze ribbon
  • On right clicking any Pivot Table
  • By pressing ALT+F5 (refreshes single pivot) or CTRL+ALT+F5 (refreshes all pivots)

Refresh and change data source options - Excel Pivot Table Analyze ribbonWhat if you want to point Pivot to new data?

Select any cell in the Pivot Table and from Analyze ribbon, use the “Change Data Source” button. Point input data to a new source. As long as the new data has same fields, everything will work smoothly.

 

 

Pivot Tables in Excel - Complete video tutorial

I have made a 21 minute video explaining how to create, format, customize, visualize, filter and refresh Pivot Tables. This video is packed with many tricks, ideas and inspiration. Check it out below.

Download - Sample data & example Pivot Tables

Please click here to download the sample file for this article. It contains fictional sales data, several example pivot tables, charts and additional resources. 

Examine the pivot table settings and use the data to learn more.

Next Steps

Now that you are familiar with Pivot Tables, explore these additional pages to learn more about data analysis & reporting.

Beginner:

Intermediate & Advanced Users:

Recommended Websites & Books:

These are my favorite places to learn more about Pivot Tables.

Websites:

Books:

Courses:

Happy Learning.

 

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

24 Responses to “10 Supercool UI Improvements in Excel 2010”

  1. Hui... says:

    The best improvement by far is the Collapse Ribbon ^ button !

  2. Alex Kerin says:

    Kind of a shame that some of the best improvements are actually returns to old functionality. One thing I don't like is that to get to recent files I need to do an extra click after File - apart from Save As, that's why I'm usually in the File menu. I like the sparkline options, though they are still as not fully featured as some of the free and pay options out there.

  3. Arti says:

    The collapse button for the ribbon menu is good news. Can you make the ribbon menus stick too?

  4. Jon Peltier says:

    Nine improvements, not ten. You can also select multiple objects in 2007. Click on the Find & Select item at the far right of the Home tab, and the dropdown looks remarkably like your 2010 screenshot.

  5. Chandoo says:

    @Jon.. Thank you. Dumb me, I somehow thought we couldnt select objects in Excel 2007. Just saw the "select menu" and it is there. I have corrected the post and removed the point. I have added the "you can make your own ribbons" instead. Thanks once again.

    @Arti: what do you mean by make ribbons stick?

    @Alex: May be it is my installation, but when I go to "File menu" I see "recent files" by default.

  6. Arti says:

    For example, if I am working with one of the contextual ribbon menus (Pivot tables, Drawing/Chart etc), as soon as I click away from the selected object, the menu tabs vanish. If I click on the object again immediately, then Excel will remember what I was looking at, but if I wander away and click on a Pivot, then back again on the Chart, the menus will 'appear' but not get activated, thereby causing much annoyance and additional clicking.

    I want to "pin" the whole menu (not invididual commands) somehow, so that I can have the menu there for the length of the time I am working with graphics. Excel 2003 used to have the Drawing toolbar you could detach and hover while you were working, but this functionality disappeared in Excel 2007.

    My thought was Excel should just allow a 'pin', similar to the Recently Opened files menu, for the Ribbon Menus as well. If I have not selected any Drawing object, the commands can be greyed out, but I want the menu as a whole to 'stick'.

  7. Chandoo says:

    @Arti... I think MS solved this problem differently. When I select a pivot and go to "design" tab Excel 2010 remembers this and automatically takes me to "design" tab when I reselect the pivot.

    Apart from this you can also define your own ribbon with all the things you normally do. See the above article (I have added this after Jon's comments)

  8. Stephen says:

    Nice feature. About time for a upgrade for MS Office

  9. Arti says:

    Oh... okay. That might be a start. I'd probably just copy-paste the Drawing tab haha. Thanks. I'll definitely give Excel 2010 a try.

    Btw - have you considered getting into / gotten into the world of Excel as it meets SharePoint?

  10. Jon Peltier says:

    Actually, the replacement new thing is probably better than all the rest. One thing that the designers of the Office 2007 ignored was allowing regular users to customize their own interface. Office 2010's interface was expanded in this way to address the huge uproar.

  11. jeff weir says:

    Is there still a limit on how many things you can add to the QAT bar? (I'm too lazy to look myself.)

  12. Chandoo says:

    @Jeff.. it seems to take quite a few, but only shows one line and gives a little arrow button at the end. (summary: shucks!)

  13. Squiggler says:

    The best thing is you can edit the ribbon directly from excel, so now i can create my own bar with just the things I use regularly!

  14. John says:

    One of the annoying things in 07 for me is the Add-Ins menu bar - in 03 I could keystroke directly to menu add ins.. In 07 I needed an extra keystroke just to activate the add-in menu, then the keystrokes as normal.. Hope this marek sense..

  15. Jon Peltier says:

    John -
     
    If you remember the old Excel 2003 Alt-key shortcuts, you can still use them in 2007. To get to the Add-In dialog:
     
    Alt-T-I

  16. Gagan says:

    Dear Arti & Chandoo

    Seen your comments over some issues. Hope you are form India, gone through your comment expecting a pin to command it as a whole, great, hope if someone out of MS have read it, it may be kept in mind while the next R & D of Office Ver. 16

  17. Loranga says:

    Just incase someone forgot CTRL+F1 will collapse the ribbon.

  18. [...] was pleasantly surprised when I ran Microsoft Excel 2010 for first time. It felt smooth, fast, responsive and looked great on my [...]

  19. DK Samuel says:

    I like the sparklines, and the ability to modify the charts

  20. CHRIS LUNA says:

    How do you get rid of the advertisment on the right hand side? If you upgrade then will it take off the ads?

  21. Derek says:

    Once again Microsoft has re-decorated the Office and we are NOT pleased!

    The graphics object selector can be found in the Home ribbon under Find & Select, Select Objects near the bottom of the drop down. You can make it part of the Quick Access toolbar by right click over it and selecting Add to Quick Access toolbar.

    The graphics "cursor" will now appear on the mini-toolbar at the top left of the window.

  22. Vladimir says:

    How to get rid of "Add-Ins" button in Backstage (File)" menu by means of XML code, i.e. to hide, to delete or to disable this button?

    This button is usually situated in the Backstage menu between "Help" and "Options" buttons.

    • Pete Kies says:

      Vladimir, did you ever get an answer to your question?

      I am tying to customize the ribbon UI for a file using XML, and this is precisely the piece I can't figure out. I can hide other tabs, remove items from QAT and backstage - all except the options that are showing up under add-ins in backstage. If there is an XML syntax for referencing this thing and making it invisible, I cannot find it.

  23. Bishnu says:

    Hey, nice tutorial. Please check my video tutorial on similar topic at the below link and provide your comments:
    http://www.youtube.com/watch?v=TeIFc0jYjpA

Leave a Reply