Ravindra BagaleCourses & study guides मराठी Track your progress

7. PivotTables and PivotCharts

7.1 Creating a PivotTable

Create a PivotTable with example — in 30 seconds

What: A PivotTable groups and totals your rows by dragging fields. No formulas needed.

Why: Sales by city for ten rows is easy by hand. For 50,000 rows it is a pivot or nothing.

Tiny example: Rows = City, Values = Sum of Amount. Six city totals appear, Grand Total ₹2,870.

First look at the data (before → after):

Create a PivotTable with example: before and after tables, fictional FreshGo Maharashtra data

Expected result — PivotTable result

Row Labels Sum of Amount
Kolhapur 232
Nagpur 240
Nashik 360
Pune 544
Sambhaji Nagar 195
Solapur 1,299
Grand Total 2,870

About this data: Teaching sample for a fictional shop “Maple Bakery Co”. Figures and names (e.g. Aarti Kulkarni) are made up for this lesson on creating a pivottable.

Before table and formula as text

Before — tblMini (first 5 of 10 rows shown)

Order ID City Amount
BLK-1001 Pune 64
BLK-1002 Nashik 270
AMN-1003 Pune 110
BLK-1004 Nagpur 240
AMN-1005 Kolhapur 232

About this data: Demo table only — not real customer or company data. Built to practise creating a pivottable.

Formula / click path

Insert › PivotTable › From Table/Range › New Worksheet
Rows: City · Values: Sum of Amount

Do it step by step:

  1. Click any cell in the data.
  2. Click Insert › PivotTable › From Table/Range. Choose New Worksheet and click OK.
  3. In the field list, tick City. It goes to Rows.
  4. Tick Amount. It goes to Values as Sum of Amount.
  5. Check the Grand Total: 2,870.

Steps in Excel

  1. Make sure the source is a clean Table (tblOrders): one header row, no blank rows, no merged cells, one type of data per column.
  2. Click inside it › Insert › Tables › PivotTable (in Microsoft 365 the button may show From Table/Range – may vary by version).
  3. Table/Range: tblOrders › choose New Worksheet › (optional) tick Add this data to the Data Model if you need Distinct Count or multiple tables › OK.
  4. The PivotTable Fields pane opens on the right. Tick or drag fields into the areas.
  5. Two new ribbon tabs appear when a cell of the PivotTable is selected: PivotTable Analyze and Design.
  6. Recommended PivotTables (Insert › Tables) suggests ready layouts – useful for beginners.

Worked example – mini dataset of Module 3. Drag City to Rows and Amount to Values:

Row Labels Sum of Amount
Kolhapur 232
Nagpur 240
Nashik 360
Pune 544
Sambhaji Nagar 195
Solapur 1,299
Grand Total 2,870

About this data: Made-up rows so you can copy the pattern for creating a pivottable. Currencies may use ₹, £, € or $.

Ravindra Bagale's Tip

Many students select a range (A1:I500) for a PivotTable – then, when new rows are added, they don't show up even after a refresh. Always make a Table (Ctrl + T) first and build the PivotTable on that Table. If the source has an empty header or merged cells, the PivotTable won't be created – clean the data first.

Practice task

Create a PivotTable of sales by City from tblOrders on a new sheet named Pivot_City. Add five new orders to the Table and refresh to see them included.

Loading practice tasks...

  1. Total units sold (Easy): Add up Units sold in the "Units sold" column.
  2. Average price (Easy): Average of the Price (₹) column, rounded to 2 decimals.
  3. Rows in Snacks (Easy): How many rows have Category "Snacks"?
  4. Largest units sold (Easy): The largest value in the "Units sold" column.
  5. Units sold for Snacks (Medium): Total of the Units sold column where Category is "Snacks".
  6. Snacks in Bengaluru (Medium): Total of the Units sold column where Category is "Snacks" and City is "Bengaluru".
  7. Best in Snacks (Medium): Largest value in the "Price (₹)" column where "Category" is "Snacks".
  8. Value of row 2 (Medium): Multiply the first-row Units sold by the first-row Price (₹).
  9. Look up Ananya Nair (Medium): The Units sold for "Ananya Nair" (use a lookup on the "Name" column).
  10. Total value (Hard): Sum of "Units sold" times "Price (₹)" for all rows.
  11. Share of Snacks (Hard): Share of the "Units sold" column that is "Snacks", rounded to 3 decimals.
  12. Total "Units sold" for Snacks (Hard): Add up the "Units sold" column for the rows where "Category" is "Snacks".
  13. Above average? (Hard): "Above" if the "Price (₹)" value in the first row is above the average of the "Price (₹)" column, else "Below".

Worked example — creating a pivottable

Why

Vikram Rao in Pune and Oliver Bennett abroad both need a clear, repeatable way to use creating a pivottable on a CityBasket Retail sheet without breaking totals.

What

Creating A Pivottable is the Excel idea this page teaches. We will walk one tiny example end to end.

How

  1. Open a blank sheet. In A1 type a short label for creating a pivottable.
  2. Enter a small made-up value for Vikram Rao using € where money appears.
  3. Add a second value for Oliver Bennett using £ so you see mixed currencies stay numeric.
  4. Apply the method from this lesson step by step (menu or formula as shown above).
  5. Check the result still works inside SUM or a simple check cell.

Formula / action

Follow the formula or ribbon steps shown in this lesson (keep values numeric).
Result: The demo cell shows the expected result for CityBasket Retail's sample row.
Meaning: Once creating a pivottable is correct on one row, copy the same pattern down the column.

Quick revision cards

Three standalone cards. Each one explains the idea with its own example. Scan the QR to open this lesson.

Revision card 1: What is Creating A Pivottable?
Card 1: What is Creating A Pivottable? · Download PNG
Revision card 2: Tiny example — Creating A Pivottable
Card 2: Tiny example — Creating A Pivottable · Download PNG
Revision card 3: Checklist — Creating A Pivottable
Card 3: Checklist — Creating A Pivottable · Download PNG