Pivot Tables in Excel 2013

Embed Size (px)

Citation preview

  • 8/16/2019 Pivot Tables in Excel 2013

    1/5

     

    1

    Excel 201 - Using Pivot Table

    Overview

    A PivotTable report is an interactive table that allows youto quickly group and summarise information from a datasource. You can rearrange (or pivot) the table to displaydifferent perspectives and you can display the details forspecific areas of interest.

    Creating a Data Source in Excel

     The data to be used in a PivotTable or PivotChart must beset up in a list format and the following rules must beadhered to:

      Each column is a field of data. Each field should onlycontain one piece of information (e.g. a date, not a dateand contract duration.) There must be a clear columnheading to describe each column of information.

       The column headings must all be on just one row, andeach heading should be unique.

       The column headings should be formatted differentlyfrom the data (e.g. make them bold)

       The column headings must either be row1 or have anempty row above it.

      Each row is a record of data, with data in at least oneof the data columns. The records must be on individual

    rows, immediately under the headings.

       The information must form a solid block and cannotcontain any interveningblank rows or columns.

      A column may be empty of data, provided that it has aheading.

    Creating a PivotTable

    1. Select any cell within the range of data.

    2. Select the Insert tab.

    3. Click the PivotTable button in the Tables group of the ribbon.

    4. Select the data type to be analysed, viz. a table orrange or, an external data source.

    TIP  If using an Excel table or range, Excel will automatically pickup the range to be analysed as long as your data is in a recognisedlist format (see, Creating a data source in Excel earlier in thisguide). This can be adjusted manually, if required.

    5. Select where you want the PivotTable placed, viz. a new worksheet  or, the  existing worksheet. Ifselecting the existing worksheet, you must also specifythe cell into you want the top left-hand corner of thePivotTable to be placed.

    6.

    Click OK .7.  The area for the PivotTable will then be displayed on

    the sheet, together with the PivotTable Fields Listand the PivotTable Tools made available at the rightof the ribbon tabs.

    8. Fields can then be dragged from the Choose fieldsbox to the areas in the bottom half of the PivotTableFields box, to the Filters , Columns , Rows and Values  boxes at the bottom of thePivotTable Fields List. 

    Fromthis….

    ….to this

  • 8/16/2019 Pivot Tables in Excel 2013

    2/5

     

    2

    Excel 201 - Using Pivot TableUse the Rows and Columns areas to summarize the datainto groups. You can use both areas, if desired.

    Use the Values area to create summary calculations at theintersection of each row and/or column. By default, thevalue area will sum numeric data or count text data. Thesecan, if desired, be changed later.

    Use the Filters area to filter data by selecting a value froma drop-down list.

    As you add fields to these boxes, Excel will construct thePivot table by groupingdata in the Row Labels field(s) intothe Row area, the Column Labels field(s) in the Columnarea. Fields placed in the Value box will be added to theData area and fields added to the Filters box will appear inthe area above the pivot table.

    In the example below, Full Name   has been placed in theRows box,Type  in the Columns box,Amount  in the Value box andRegion  in the Filters box.

    TIP:  Alternatively, items can be ticked in the Choose fields to add

    to report:   list in the PivotTable Field li st   directly onto thePivotTable into the Drop Page Fields Here , Drop Column FieldsHere , Drop Row Fields Here  and Drop Data Items Here  areas.

    If you decide to drag fields directly into the PivotTableareas, look out for the following symbols on the mousepointer:

    Add to Row

    Add to Column

    Add to Value

    Add to Filters

    Using multip le fields

    1. Additional fields can be added to the Filters,

    Columns, Rows andValue areas.2. Click onto the PivotTable that you want to add fields

    to. This will activate the PivotTable Field List and thePivotTable Tools.

    3. Drag and drop your chosen fields from the Choosefields to add to report:  list into the appropratebox(es) at the bottom of the PivotTable Fields List.

    4. Look out for the blue/green line as as you click anddrag the field over the boxes. The position of this linewill affect how the data is displayed on the PivotTable.For example:

    5. Will subdivide each Salesperson group into Types.

    6. Whereas:

    7. Will subdivide Regions into each Salesperson.

    M oving a field

    1. If you add more than one data field into an area, youcan arrange the fields in the order that you want.

    2. At the bottom of the PivotTable Fields List, clickthe drop-down arrow at the right of the field that you

    want to move .

    3. Select the appropriate Move  (Up; Down; toBeginning; to End etc.) command.

    OR

    4. Click and drag the field header from one box toanother. For example, you could drag a field from theColumns box to the Rows box, or drag one fieldname above another if the area contains more than onefield.

    Removing a field

    1. Click and drag the field header out of the PivotTable

    fields box. The following symbol next to the mousepointer will indicate that it is in the right position for

    the field to be removed .

    2. OR:

    3. At the bottom of the PivotTable Field List, click thedrop-down arrow at the right of the field that you wantto remove.

    4. Select Remove Field.

  • 8/16/2019 Pivot Tables in Excel 2013

    3/5

     

    3

    Excel 201 - Using Pivot Table

    Organising PivotTable Data

    Filtering

    When a PivotTable has beencreated, items can be hiddenfrom the Row or Columnareas by clicking the drop

    down arrow at the end of theheading and unchecking itemsto be hidden or shown.Remember to clickOK .

     The Page area may be used in asimilar way but selecting an entryfrom the list will filter out all datanot meeting this criteria when youclick OK.

    Viewing underlying records

    Double clicking a value in the Data area, will give you abreakdown of the figures used to make up the value on aseparate sheet.

    Sorting

    By default, data will be shown in ascending order fornumbers or A-Z for text. If you amend or add new datayou may wish to re-sort data or adjust the sort order.

    1. Click the drop-down arrow at the right of the fieldheader that you want to sort on.

    2. Click Sort A to Z, Sort Z to A or More SortOptions…

    .

    Pivot table Optio ns

    Additional options for fine-tuning and setting preferencesfor how your PivotTable works can be found by:

    1. Clicking the Analyze tab of the PivotTable Tools onthe Ribbon.

    2. Clicking theOptions button in the PivotTable group.

    3.  Two of the most useful of these are:

    4. Totals & Filters tab   - Show grand totals for rows (orcolumn). This allow you to decide whether each rowor column of data has a total at the right (for rows) orat the bottom (for columns).

    5. Data tab  - Refresh data when opening the file. This willautomatically refresh its view of the data when youopen the workbook. Please note that this will notautomatically extend the data range to new data (seeAdding data to your PivotTable, later in this guide).

    Modifying the Value Field‘s Calculations

    By default, in the Value area, numeric values are summed

    and text values are counted. The get the PivotTable tocarry out a different calculation on the data:

    1. At the bottom of the PivotTable Fields List, clickthe down-arrow at the right of the value field button.

    2. Select Value Field Setting….

    3. From the Summarize values by: list select the typeof calculation required

    4. Click OK .

    5. OR

    6. Right-click one of the values and select SummerizeData By 

    M ultiple Data fields

     You can add a field more than once to the Data area and

    set the first instance to sum and the second to count so asto show the total value and the number of instances

    1. In the PivotTable Fields List, add the field for thesecond calculation to the Value area.

    2. Click the down-arrow at the right of the value field

    button .

    3. Select Value Field Setting….

    4. From the Summarize values by: list select the typeof calculation required

    5. Click OK .

    NB : The field summary heading will change e.g. from Sum of to Count of .

  • 8/16/2019 Pivot Tables in Excel 2013

    4/5

     

    4

    Excel 201 - Using Pivot Table

    Adding Data to your PivotTable

    When you amend any of the data within the range of datacurrently being used to generate the PivotTable or Chartyou must refresh the PivotTable. If you add extra data tothe range you will need to adjust the PivotTable’s datarange.

    Refreshing dat a

    1. Select any cell on the PivotTable.

    2. Click the Options  tab in the PivotTable Tools section of the Ribbon.

    3. Click the Refresh button in theData group.

    NB: The button has a drop-down arrow from which you can

    select Refresh All. This will refresh ALL PivotTables in the

    workbook which are based on the same source data as the

    selected one.

    4.  The PivotTable(s) will be re-drawn to show theamended data

    Adding data

    When you created the Pivot Table you specified a range ofdata to be plotted. If you add new data at the end of yourlist, you will need to adjust the PivotTable’s data range.Merely using the Refresh button does not do this! 

    1. Select any cell on the PivotTable

    2. Click the Options  tab in the PivotTable Tools 

    section of the Ribbon.3. Click Change Data Source  in the Data  group.

    4.  Type or re-select the data range upon which to basethe amended Pivot Table.

    5. Click OK .

    Formatting a Pivot Table

    A PivotTable can be formatted like any other spreadsheet. Ifyou format cells, then check that the Pivot Table optionPreserve cell formatting on update is turned on.

    AutoFormat ting a PivotT able

    1. Select a cell on the PivotTable2. Select the Design  tab in the PivotTable Tools 

    section of the ribbon.

    3. Click a button in the PivotTable Styles group of theribbon.

    Tip: Moving the mouse pointer over the sty les will preview the

    style on the PivotTable. The style, however, is only applied

    when the button is clicked.4. Fine-tune a style by checking and/or unchecking the tick

    boxes in the PivotTable Style Options group of theribbon.

    Tip : To reset the PivotTable style to the default, select the “None”style in the top left of the PivotTable styles button.

    Pivot Charts

    A Pivot Chart is an interactive graphical representation ofthe data in a Pivot able.

     You can rearrange the layout, select a different type ofchart, and add or remove data.

    Creating a PivotChar t from scratch

    1. Select any cell within the range of data.

    2. Select the Insert tab.

    3. Click the PivotChart button in the Chartsgroup

    4. Select the data type to be analysed, viz. a table orrange or, an external data source.

    TIP If using an Excel table or range, Excel will automaticall y

    pick up the range to be analysed as long as your data is in a

    recogni sed list format (see, Creating a data source in Excel

    earlier in this guide). This can be adjusted manually, if

    required.

    1.

    Select where you want the PivotChart placed, viz. a new worksheet  or, the  existing worksheet. Ifselecting the existing worksheet, you must also specifythe cell into you want the top left-hand corner of thePivotChart to be placed.

    2. Click OK .

    3.  The area for the PivotChart will then be displayed onthe sheet, together with the PivotTable Field List, aPivotChart Filter Pane  and a PivotChart Tools section at the right of the ribbon tabs.

    NB: As well as the new PivotChart a new PivotTable will have

    been created, the two are permanently linked

    1. Fields can then be dragged from the Choose fields toadd to report:  list in the PivotTable Field list, tothe Filters , Legend (Series)… , Axis(Categories) , and Values  boxes at the bottom of thePivotTable Field List. 

    Use the Axis Fields area to specify what the PivotChartgroups and displays along the horizontal (x) axis.

  • 8/16/2019 Pivot Tables in Excel 2013

    5/5

     

    5

    Excel 201 - Using Pivot TableUse the Legend (Series) area to specify what thePivotChart groups and displays as columns for each“category” in the Axis field.

    Use the Valuesarea to specify what the PivotChart uses todetermine the height of each column against the vertical (y)axis. By default, the value area will sumnumeric data orcount text data. This can, if desired, be changed later.

    Use the Filter to filter data by selecting a value from thedrop-down list which subsequently appears in the top-leftof the chart

    In the example below, Full Name has been placed in theAxis Fields box, Region in the Legend box, Amount in theValue box and Type in the Report Filter box.

    Creating a Pivot Char t from an existing PivotT able

    1. Click any cell on the PivotTable

    2. Select the Analyze  tab in the PivotTable Tools section of the ribbon.

    3. Click the PivotChart button in the Tools group ofthe ribbon

    .

    4. Select the type of chart that you want to create.

    5. Click OK .

    6. Any change made to the PivotTable will be reflected inthe PivotChart and vice versa

    Filteringand/or Sorting Values Wit hin t he Chart.

    Filter buttons will be available from within the chart area

    1. Click the down-arrow for the part of the PivotChartthat you want to filter or sort.

    2. Select your preferences.

    3. If hiding or un-hiding items, remember to click OK .

    Multiple f ields

    As with a PivotTable, you can place multiple fields in anyPivotChart area. As you drag the field over the differentareas at the bottom of the PivotTable Field List, look outfor the blue bar to indicate where the field will go becausethis will affect the final result. For example, arranging theAxis fields as follows:

    Will result in the following PivotChart:

    Whereas arranging the axis fields thus:

    Will produce the following:

    Formatting the PivotChart

    Once you have created your PivotChart you may wish tocarry out changes to its structure and layout.

    Use for this purpose, the Analyze, Design  and/orFormat  tabs in the PivotChart Tools  section of theribbon. For further information on how to use these tools,refer to the Charting in Excel 2013 Quick Reference Guide .

    Refreshing a PivotChart

    1. Click on the PivotChart.

    2. Click the Refresh button in the Data group of thePivotTable Tools section of the ribbon.

    Tip : If the PivotChart has been created from an existingPivotTable, the PivotChart will automatically refresh whenever thePivotTable upon which it is based is refreshed.