Open In App

Pivot Tables in Excel – Step by Step Guide

Last Updated: 12 Dec, 2024

R

Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

Pivot Tables are one of the most powerful features in Excel, allowing you to analyze, summarize, and visualize large sets of data with ease. Whether you’re tracking sales figures, analyzing trends, or creating reports, if you know how to do Pivot Tables then you can turn raw data into meaningful insights in just a few clicks.

In this step-by-step guide, you will learn to create a Pivot Table in Excel from scratch, how to insert a Pivot Table, drag and drop fields for analysis, apply filters, and even customize the table to match your specific needs. This guide will help you to transform raw data into clear, actionable insights that save time and improve decision-making.

how-to-create-a-pivot-table-in-excel-(1)

How to Create a Pivot Table in Excel

How to Create a Pivot Table in Excel

Looking for easy ways and methods to create pivot table in excel? Follow the below steps on how to build a pivot table in excel:

Step 1: Open Excel Worksheet and Prepare Your Data

Before creating a pivot table, ensure your data is properly formatted:

  • Organize in a Tabular Format:
    • Place your data in rows and columns, with each column having a header.
  • Avoid Blank Rows or Columns:
    • Ensure there are no empty rows or columns within your dataset.
  • Name Your Data Range (Optional):
    • Highlight your data and assign a name via Formulas > Define Name for easier reference.
image-

Prepare your Data

Step 2: Select Your Data

  1. Click anywhere within your dataset.
  2. Alternatively, highlight the specific data range you want to use for the pivot table.

Step 3: Go to Insert Tab > Insert the Pivot Table

Go to the Insert tab on the Excel ribbon and Click PivotTable from the menu. Then Click OK to create the pivot table layout.

image-

Select your Data >>Go to Insert Tab>> Select Pivot Table

Shortcut Keys

  • Windows: Press Alt + N + V to open the Create PivotTable dialog box.
  • Mac: Press Command + Option + P to create a pivot table.

In the Create PivotTable dialog box:

  • Confirm the selected data range or adjust it as needed.
  • Choose where you want the pivot table to be placed:
    • New Worksheet: Creates the pivot table in a new worksheet.
    • Existing Worksheet: Lets you place it in a specific location on the current sheet.
image

Select your Range>> Select your Sheet and Press OK

Step 4: Build Your Pivot Table

You’ll see a PivotTable Field List pane on the right side of your screen. This is where you organize your data:

image-

Build your Pivot Table

Drag and Drop Fields:

Drag column headers from the Field List into one of the four areas:

  • Rows: Sets rows for the table.
  • Columns: Creates columns for your data.
  • Values: Adds numerical data to be calculated (e.g., sum, count).
  • Filters: Adds filters to refine your analysis.
image-

Drag the Fields

Customize Calculations:

Right-click on a value in the Values area and choose Value Field Settings. Then, Select the desired calculation (e.g., Sum, Average, Count).

Step 5: Format and Customize Your Pivot Table

  1. Apply a PivotTable Style:
    • Select your pivot table and go to Design > PivotTable Styles to apply a pre-designed format.
  2. Sort and Filter:
    • Use the dropdown arrows on row or column headers to sort and filter data.
  3. Group Data:
    • Right-click on a row or column item and select Group to organize data by date, number ranges, etc.
  4. Add Slicers (Optional):
    • Go to Insert > Slicer to create interactive filters for your pivot table.

Shortcut Key

  • Windows/Mac: Press Alt + J + T + F (Windows) or Command + Shift + P (Mac) to toggle the Field List pane for editing fields.

Step 6: Refresh Your Pivot Table

If your source data changes, update the pivot table by:

  1. Clicking anywhere in the pivot table.
  2. Going to PivotTable Analyze > Refresh.

Select Entire Pivot Table Shortcut Key

  • Windows/Mac: Press Ctrl + A (or Command + A on Mac) to select the entire pivot table.
image

Analyze >> Refresh

Pivot Table Creation – Additional Tips

  • Avoid Blank Columns or Rows: Ensure your data range doesn’t contain entirely blank columns or rows, as they can disrupt pivot table creation.
  • Use Excel Tables for Source Data: Converting your data range into an Excel Table helps maintain data integrity and automatically updates the pivot table with new data.
  • Regularly Update Data Sources: After adding new data, always refresh your pivot table to include the latest information.

Pivot Table Troubleshooting: Errors and Fixes

1. “Pivot Table Field Name Is Not Valid” Error

Cause: This error occurs when one or more columns in the source data lack headers or contain merged cells.

Solution:

  • Ensure All Columns Have Headers: Verify that every column in your data range has a unique header.
  • Unmerge Cells: Check for and unmerge any merged cells within the header row.
  • Select the Correct Data Range: When creating the pivot table, ensure you’re selecting only the relevant data range, not the entire worksheet.

2. New Data Not Appearing After Refresh

Cause: Adding new rows to the source data without updating the pivot table’s data range can prevent new data from appearing after a refresh.

Solution:

  • Update the Data Source Range: Go to PivotTable Analyze > Change Data Source and adjust the range to include the new data.
  • Use Dynamic Named Ranges or Excel Tables: Implement dynamic ranges or convert your data range into an Excel Table to automatically include new data.

3. “Cannot Group That Selection” Error

Cause: This error typically arises when attempting to group data that includes blanks or non-date values.

Solution:

  • Fill or Remove Blanks: Ensure there are no blank cells in the data you’re trying to group.
  • Verify Data Types: Confirm that all data intended for grouping are of the same type (e.g., all dates or all numbers).

4. Pivot Table Not Sorting Correctly

Cause: Incorrect sorting can result from unsorted source data or incorrect field settings.

Solution:

  • Sort Source Data: Ensure the source data is sorted correctly before creating the pivot table.
  • Adjust Field Settings: Right-click the field in the pivot table, select Sort, and choose the desired order.

5. “There Are Too Many Records to Complete This Operation” Error

Cause: This error may occur when the pivot table has complex calculations or multiple fields causing performance issues.

Solution:

  • Simplify the Pivot Table: Reduce the number of fields or calculations to lessen the load.
  • Check for Calculated Items: Go to PivotTable Analyze > Fields, Items & Sets > Solve Order and remove any unnecessary calculated items.

Conclusion

Creating a pivot table in Excel is an essential skill for organizing, analyzing, and summarizing large datasets efficiently. With Excel pivot tables, you can quickly identify patterns, trends, and anomalies in your datasets. Whether you’re a beginner looking to learn the basics or an advanced user seeking pivot table troubleshooting tips, this tutorial covers everything you need to know about creating pivot tables in Excel.

Pivot Table in Excel – FAQs

What is a Pivot Table in Excel?

A Pivot Table in Excel is a powerful tool that helps you summarize, analyze, and organize large data sets. By dragging and dropping fields, you can quickly view data in different ways, making it easier to generate insights and reports

What is a Pivot Table Used For?

A pivot table is used to summarize, analyze, explore, and present large amounts of data in a concise, tabular format. It allows users to reorganize and group data dynamically, making it easier to identify patterns, trends, and insights.

How do I create a PivotTable with rows and columns?

To create Pivot Table with rows and columns follow the steps given below:

  • Select Your Data
  • Go to the Insert tab
  • Drag the rows
  • Drag the Columns

Can I Create a Pivot Table from Multiple Sheets?

Yes, you can create a pivot table from multiple sheets by using the Data Model feature in Excel. This involves adding each data range to the Data Model and then creating relationships between the tables. This is a more advanced technique and requires some setup.

How Can I Add or Remove Fields in a Pivot Table?

To add or remove fields:

  • Add Fields: Drag the desired field from the PivotTable Field List into the Rows, Columns, Values, or Filters area.
  • Remove Fields: Drag the field out of the area or uncheck it in the PivotTable Field List.

This allows you to customize the pivot table to display the data you need.

What is a Pivot Table XLS file?

An Excel Pivot Table saved in .xls format refers to an older version of Excel files. You can create and work with Pivot Tables in both .xls and newer .xlsx formats.

How do I create a pivot chart from Excel data?

Here are the steps to create a pivot table from the Excel data:

  • Go to the Insert tab
  • Click on PivotTable
  • Customize the PivotChart

Can I use Pivot Tables in Excel to create summaries?

Yes, doing Pivot Tables in Excel allows you to create summaries, aggregate data, and easily view key metric

How do I use Pivot Tables in Excel for Data Analysis?

To analyze data with Pivot Tables, you can group, filter, and sort data, perform calculations, and create custom views. Excel with Pivot Tables simplifies complex data analysis tasks.

How Do I Remove a Pivot Table?

To remove a pivot table:

  1. Select the Entire Pivot Table: Click and drag to highlight the pivot table.
  2. Press Delete: Hit the Delete key on your keyboard.

This will remove the pivot table from your worksheet.



R

News
Improve
Discuss
Do you want to advertise with us?Click here to know more

Pivot Tables in Excel - Step by Step Guide

article_img
Pivot Tables are one of the most powerful features in Excel, allowing you to analyze, summarize, and visualize large sets of data with ease. Whether you're tracking sales figures, analyzing trends, or creating reports, if you know how to do Pivot Tables then you can turn raw data into meaningful insights in just a few clicks.In this step-by-step guide, you will learn to create a Pivot Table in Excel from scratch, how to insert a Pivot Table, drag and drop fields for analysis, apply filters, and even customize the table to match your specific needs. This guide will help you to transform raw data into clear, actionable insights that save time and improve decision-making.How to Create a Pivot Table in ExcelHow to Create a Pivot Table in ExcelLooking for easy ways and methods to create pivot table in excel? Follow the below steps on how to build a pivot table in excel:Step 1: Open Excel Worksheet and Prepare Your DataBefore creating a pivot table, ensure your data is properly formatted:Organize in a Tabular Format:Place your data in rows and columns, with each column having a header.Avoid Blank Rows or Columns:Ensure there are no empty rows or columns within your dataset.Name Your Data
Read More

How to Create Pivot Chart from Pivot Table in Excel using Java?

A Pivot Chart is used to analyze data of a table with very little effort (and no formulas) and it gives you the big picture of your raw data. It allows you to analyze data using various types of graphs and layouts. It is considered to be the best chart during a business presentation that involves huge data. To add a pivot chart to an Excel worksheet, you need to use the "WorksheetChartsCollection.add" method.  Before Creating a Pivot Chart, one first needs to go through how to Create Pivot Table in Excel using Java. Now let's discuss the steps to create a pivot chart in an Excel file in Java using Free Spire.XLS for Java API. How to Create a Pivot Table in Excel using JavaStep 1: Load the Excel fileWorkbook workbook = new Workbook() String workbookName = "Geeks_For_Geeks.xlsx"; workbook.loadFromFile(workbookName); Step 2: Get the first worksheetWorksheet sheet = workbook.getWorksheets().get(0); Step 3: Get the first pivot table in the worksheetIPivotTable pivotTable = sheet.getPivotTables().get(0); Step 4: Add a clustered column chart based on the pivot table to the second worksheetChart chart = workbook.getWorksheets().get(1).getCharts().add(ExcelChartType.ColumnClustered, pivotTa
Read More

R

Prepare Source Data for Pivot Tables In MS Excel

article_img
A pivot table is a tool for summarizing data that is derived from larger tables. A database, an Excel spreadsheet, or any other data that is or could be transformed into a table-like shape might be these larger tables. A pivot table's data summary may include sums, averages, or other statistics that the pivot table meaningfully groups together. Given that a pivot is defined in the dictionary as "a central point, pin, or shaft on which a mechanism spins or oscillates," the term "pivot table" actually provides a good indication of the significance of pivot tables and the function they play in analysis. When it comes to conducting data analysis, this idea is crucial. You can often find all the data you've been given on a subject in a database or dataset. To derive knowledge from this raw data is the entire purpose of any analysis. A table containing thousands of rows, however, cannot be fully understood by simply looking at it and scrolling up and down. Drawing insight frequently requires you to exclude certain data points and manipulate how they show their information, for instance through summary statistics. Data analysts use summary statistics to express a lot of information as sim
Read More

How to Create Calculated Columns in Power Pivot in Excel: A Complete Guide

article_img
Power Pivot in Excel is a powerful data modelling tool that enables advanced calculations on large datasets. One of its standout features is calculated columns, which allow users to derive new data by applying custom formulas to existing columns. In this article, we’ll cover what calculated columns are, how to create them in Power Pivot, and their advantages and limitations.Table of ContentWhat are Calculated Columns in ExcelCreate Calculated Columns in Power Pivot in ExcelHow to Create Calculated Columns in Power Pivot in Excel ExamplesAdvantages of Calculated Columns in Power PivotLimitations of Calculated Columns in Power PivotUnderstanding Calculated Columns in Excel Power PivotCalculated columns are dynamic columns in Power Pivot that allow users to create new data by applying formulas or expressions to existing data. Unlike calculated fields, which are computed on-the-fly based on the context, calculated columns compute their values during data refresh. This makes them suitable for pre-computed data scenarios, such as sorting, filtering, complex calculations, or creating hierarchies.How to Create Calculated Columns in Power Pivot in ExcelFollow these steps to create calculate
Read More

How to Sort a Pivot Table in Excel : A Complete Guide

article_img
Sorting a Pivot Table in Excel is a powerful way to organize and analyze data effectively. Whether you want to sort alphabetically, numerically, or apply a custom sort in Excel, mastering this feature allows you to extract meaningful insights quickly. This guide walks you through various Pivot Table sorting tutorials, including advanced options and practical examples, ensuring you can manage your data with precision and ease.Table of ContentTypes of Sorting in Pivot TablesHow to Sort a Pivot Table in Excel: Step-by-Step Guide Advanced Sorting Options in Pivot TablePractical Examples of Sorting in Pivot TablesCommon Issues and TroubleshootingTips for Effective Sorting in Pivot TablesTypes of Sorting in Pivot TablesLabel Sorting: Sort row or column labels alphabetically or in reverse alphabetical order.Value Sorting: Sort data based on numerical values, such as totals or averages, in ascending or descending order.Custom Sorting: Arrange data in a specific order, such as months, days of the week, or a custom-defined sequence.How to Sort a Pivot Table in Excel: Step-by-Step Guide Follow the below steps to learn how to sort a Pivot Table in Excel: Step 1: Open MS Excel Sheet Open an Exc
Read More

How to Create a Graph in Excel: A Step-by-Step Guide for Beginners

article_img
Anyone who wants to quickly make observations and represent them graphically should know how to create graphs with Excel. Whether it is the preparation of business analysis papers, academic research documents or financial reports among other things, learning how to make graphs in Excel can significantly improve the way you present information derived from different sources. By exploring Excel’s vast array of options, you have what it takes to convert raw information into coherent visuals that immediately reveal any trends, consistencies, and anomalies, also we will encounter to create charts in Excel from data.In this article, we will learn to make graphs in Excel or create a graph in Excel along with the several categories of graphs such as creating pie graphs in Excel, bar graphs in Excel and so on.Table of ContentWhat is a Chart or Graph in ExcelHow to Create Charts in ExcelType of Charts in MS ExcelHow to Create Surface Graph in MS ExcelHow to Create Histogram in ExcelHow to Format the ChartHow to Change Chart TypeWhat Are Charts and Graphs in ExcelCharts and graphs in Excel are powerful tools for data visualization. They help you present and analyze data graphically, making it
Read More

How to Use the UNIQUE Function in Excel: Step by Step Guide

article_img
Do you struggle with manually removing duplicates in Excel? The UNIQUE function is here to make your life easier! In this article, you’ll learn how to quickly extract unique values from a list or range using the Excel UNIQUE function. Let’s get into the step-by-step process, formula examples, and everything you need to know. How to Use the UNIQUE Function in ExcelTable of ContentWhat is the Unique Function in ExcelKey Features of the UNIQUE FunctionHow to Use the UNIQUE Function to Remove DuplicatesHow Does the UNIQUE Function Work?Advanced Usage of the UNIQUE FunctionWhat is the Unique Function in ExcelThe UNIQUE function in Excel is a powerful tool that allows you to automatically filter out duplicate values from your data. Whether you’re dealing with a long list of names, numbers, or other data, the UNIQUE function extracts only the distinct entries, saving you time and effort. This function is part of Excel's dynamic array features and is particularly useful when working with large datasets, making data analysis and reporting a breeze.Key Features of the UNIQUE FunctionThe UNIQUE function in Excel is a part of the dynamic array features and has a few vital information to main
Read More

How to use Copilot in Excel with Examples (Step-by-Step Guide)

article_img
As of 2024, Microsoft introduced a new feature called Copilot for Excel, part of the broader Microsoft 365 suite, designed to enhance productivity and streamline data manipulation using AI-powered tools. The introduction of Excel Copilot is transforming how professionals across industries manage and interpret their data. This AI-driven tool enhances productivity, automates repetitive tasks, and simplifies complex data analysis. In this detailed guide, we'll explore how to effectively use Copilot in Excel, complete with practical examples to illustrate its capabilities.How to use Copilot in Excel with ExamplesTable of ContentWhat is Copilot in Excel?How to Access Copilot in ExcelExcel Copilot Advantages in ExcelHow to Use Copilot in Excel (November 2024)Different Ways to use Copilot in Excel (Including Copilot Prompt)What is Copilot in Excel?Microsoft Excel Copilot is an innovative, AI-powered feature designed to enhance productivity and streamline data processing tasks within Excel. As a part of the Microsoft 365 suite, Excel Copilot transforms how users interact with data by offering advanced artificial intelligence capabilities that simplify complex operations, automate repetitiv
Read More

How to Insert a Checkbox in Excel: Step-by-Step Guide

article_img
How to Add Checkboxes in Excel: Quick Steps Enable the Developer Tab >>Go to Developer TabControl Group >> Click InsertSelect Checkboxes >>Place the CheckboxesLink the Checkbox to a CellAdding interactive elements like checkboxes to your spreadsheets can significantly improve functionality and organization. Whether you're managing task lists, tracking attendance, or creating interactive reports, learning how to insert a checkbox in Excel is a valuable skill. This guide provides a detailed explanation of how to add checkboxes in Excel, covering everything from enabling developer tools to formatting and customizing the checkboxes to suit your needs.Disclaimer: Ensure your data is well-structured to maximize the benefits of using checkboxes in your spreadsheet.Insert a Checkbox in ExcelTable of ContentWhat is a Checkbox in ExcelHow to Add a Checkbox in Excel : Step-by-Step GuideHow to Get the Developer Tab in the Excel RibbonHow to Insert a Checkbox in Excel How to Customize the Checkbox in ExcelHow to Insert Checkboxes in Excel without Developer Tab How to Link a Checkbox to a Cell How to Insert Multiple Checkboxes in Excel How to Create To-Do List Using Excel Check
Read More

How to Unhide and Show Hidden Columns in Excel: Step by Step Guide

article_img
How to Unhide all Columns in Excel- Quick StepsOpen MS Excel >> Select the Entire WorksheetRight-click on Column Headers >> Select "Unhide"Columns VisibleUnhiding columns in Excel is a simple but essential task when working with hidden data. Whether to make a worksheet look cleaner or accidentally disappeared, knowing how to unhide them ensures all your information is accessible and organized. This guide will walk you through step-by-step methods to unhide columns in Excel, helping you efficiently manage and analyze your data.Table of ContentWhy Do Columns Get Hidden in ExcelHow to Unhide All Columns In Excel (Windows and Mac)How to Unhide All Columns in Excel Using the Format ToolHow to Unhide All Columns by Setting the Column WidthHow to Unhide Columns in Excel Using Keyboard ShortcutHow to Unhide all Columns Automatically with VBA MacroHow to Show All Hidden Columns in ExcelHow to Check the Number of Hidden Columns in a WorkbookAlternative Method to check the Hidden Column in Excel Why Do Columns Get Hidden in ExcelColumns may be hidden intentionally to:Simplify data presentation.Protect confidential information.Organize large datasets.Columns may also appear hidden
Read More
three90RightbarBannerImg