Skip to content
← All datasets
Dataset collection

Pivot Table Practice Data for Excel, With Expected Answers

Six free Excel workbooks for PivotTable practice. Each task names the fields for Rows, Columns, Values, and Filters, and gives the expected answer.

A PivotTable is the Excel tool that summarizes a table when you drag its columns into four areas: Rows, Columns, Values, and Filters. Start with the workforce workbook to count employees by department. Move to ecommerce sales for filters, percentages of a row, and distinct counts.

Ready-made practice

Excel files for PivotTable practice

Download a workbook, build each PivotTable on its Data sheet, and compare your result with the expected answer below. Free with an account.

  • Workforce attrition practice workbook

    6,000 employees. Counts by department and status, blank cells, and an attrition rate.

    Get the workbook →
  • Ecommerce sales practice workbook

    39,922 order lines. Filters, percent of row total, a calculated margin, and a distinct count.

    Get the workbook →
  • SaaS billing practice workbook

    45,237 invoices. Billing by plan, invoice status by region, and a collection rate.

    Get the workbook →
  • Marketing campaigns practice workbook

    11,240 campaign-days. Click-through rate and return on ad spend as ratios of totals.

    Get the workbook →
  • Bike sharing practice workbook

    8,734 hourly rows for 2012. Averages by hour and totals by month.

    Get the workbook →
  • Inventory purchase orders practice workbook

    18,000 purchase orders. Blank receipt dates, order value by country, and a fill rate.

    Get the workbook →
  • Flat sales file

    237,537 order lines from 2023 to 2025 in one CSV file, for a PivotTable on a larger table.

    Get the flat file →
  • Formula tasks for the same workbooks

    SUMIFS, XLOOKUP, and AVERAGEIFS practice, with a comparison of what each workbook contains.

    Open Excel practice data →
Compare your options

Choose a dataset for the work you want to complete

DatasetOne row in the Data sheetFirst PivotTable to buildWhat it teachesTasks with answers
Ecommerce Sales & ReturnsOne order lineSum of line_total by category, with cancelled orders filtered outReport filters, % of row total, calculated margin, distinct countPractice workbook included
SaaS Subscriptions & ChurnOne invoiceSum of amount_due by plan_name, with void invoices filtered outTwo-way counts by region and status, and a collection ratePractice workbook included
Marketing Campaigns & ConversionsOne campaign per day of spendSum of spend and Sum of revenue by channelRates as calculated fields instead of averaged ratio columnsPractice workbook included
Inventory & Supply ChainOne purchase orderSum of order_value by supplier_countryBlank dates, counts that skip empty cells, and a fill ratePractice workbook included
Workforce & Employee AttritionOne employeeCount of employee_id by department_name and employment_statusCounting text, blank items, averages, and an attrition ratePractice workbook included
Bike Sharing DemandOne observed hourAverage of total_rentals by hour, filtered to working daysAverage against Sum, and a filter that changes the patternPractice workbook included
Checked against the files

PivotTable exercises with expected answers

Each exercise uses the Data sheet of one practice workbook. Build the PivotTable with the fields shown, then compare. Answers were computed from version 1.0.0 of each file. A calculated field is added under PivotTable Analyze > Fields, Items, & Sets > Calculated Field.

Workforce attrition: 6,000 employees

One row per employee. The attrition rate in this workbook is terminated employees divided by all employees in the group.

TaskRowsColumnsValuesFiltersExpected answer
Headcount by department and statusdepartment_nameemployment_statusCount of employee_idNoneEvery department has 500 employees. Grand Total: 4,975 active, 1,025 terminated, 6,000 in all.
Attrition rate by departmentdepartment_nameemployment_statusCount of employee_id, shown as % of Row TotalNoneCustomer Success and Sales tie for the highest terminated share at 18.80%. Legal & Compliance is lowest at 14.80%. Grand Total: 17.08%.
Average salary by job leveljob_levelNoneAverage of base_salaryemployment_status: activelead 157,663; senior 118,825; specialist 88,302; associate 66,598. Grand Total: 91,063.
Exits by termination typetermination_typeNoneCount of employee_idNonevoluntary 689, involuntary 261, retirement 75, and (blank) 4,975 for the employees who are still active.
Workforce & Employee Attrition dataset →

Ecommerce sales: 39,922 order lines

One row per order line from July to December 2025. Item revenue is line_total, after line discounts and before tax and shipping.

TaskRowsColumnsValuesFiltersExpected answer
Item revenue by categorycategoryNoneSum of line_totalorder_status: clear cancelledapparel is highest at 1,703,197.45. Grand Total: 9,856,623.89.
Item revenue by monthorder_monthNoneSum of line_totalorder_status: clear cancelled2025-08 is highest at 1,682,668.59 and 2025-09 is lowest at 1,597,924.58.
Cancelled share of order lines by channelacquisition_channelorder_statusCount of order_item_id, shown as % of Row TotalNonereferral has the highest cancelled share at 3.36%. Grand Total: 2.96%.
Gross margin by categorycategoryNoneCalculated field gross_profit / line_total, as a percentageorder_status: clear cancelledelectronics is highest at 51.2% and beauty is lowest at 49.5%. Grand Total: 50.3%.
Orders by customer segmentcustomer_segmentNoneDistinct Count of order_id (Data Model PivotTable)Noneconsumer 13,824; small_business 2,489; enterprise 523. Grand Total: 16,836 orders from 39,922 order lines.
Ecommerce Sales & Returns dataset →

SaaS billing: 45,237 invoices

One row per invoice issued in 2025. amount_paid equals amount_due on paid invoices and is 0 on open and void invoices.

TaskRowsColumnsValuesFiltersExpected answer
Amount billed by planplan_nameNoneSum of amount_dueinvoice_status: clear voidEnterprise is highest at 6,088,391. Grand Total: 15,358,469.
Invoices by region and statusregioninvoice_statusCount of invoice_idNoneNA has the most open invoices, 1,179. Grand Total: 4,678 open, 40,539 paid, 20 void.
Collection rate by planplan_nameNoneCalculated field amount_paid / amount_due, as a percentageinvoice_status: clear voidEnterprise is lowest at 89.2%. Grand Total: 89.5%.
SaaS Subscriptions & Churn dataset →

Marketing campaigns: 11,240 campaign-days

One row per campaign per day of spend. Rates are ratios of totals, so use calculated fields instead of averaging a rate column.

TaskRowsColumnsValuesFiltersExpected answer
Spend and revenue by channelchannelNoneSum of spend and Sum of revenueNonepaid_social has the highest spend, 984,731.88, and affiliate the highest revenue, 5,610,700.73. Grand Total: spend 4,523,050.02 and revenue 21,561,839.01.
Return on ad spend by channelchannelNoneCalculated field revenue / spendNoneaffiliate is highest at 6.54 and video is lowest at 2.52. Grand Total: 4.77.
Click-through rate by channelchannelNoneCalculated field clicks / impressions, as a percentageNonepaid_search is highest at 3.49% and display is lowest at 0.60%. Grand Total: 1.63%.
Marketing Campaigns & Conversions dataset →

Bike sharing: 8,734 hours in 2012

One row per observed hour. is_working_day is 1 on working days and 0 on weekends and holidays.

TaskRowsColumnsValuesFiltersExpected answer
Average rentals by hour on working dayshourNoneAverage of total_rentalsis_working_day: 1Hour 17 is highest at 656.2, then hour 18 at 617.0 and hour 8 at 604.5.
Rentals by monthmonthNoneSum of total_rentalsNoneMonth 9 is highest at 218,573. Grand Total: 2,049,576.
Casual and registered rentals by day typeis_working_dayNoneSum of casual_rentals and Sum of registered_rentalsNone0: 187,834 casual and 425,596 registered. 1: 184,931 casual and 1,251,215 registered.
Bike Sharing Demand dataset →

Inventory purchase orders: 18,000 orders

One row per purchase order. received_at is empty for open and cancelled orders.

TaskRowsColumnsValuesFiltersExpected answer
Order value by supplier countrysupplier_countryNoneSum of order_valueNoneDE is highest at 1,111,197,516.23. Grand Total: 7,005,563,315.32.
Purchase orders by statusstatusNoneCount of purchase_order_id and Count of received_atNonereceived 15,801; partial 1,326; open 467; cancelled 406. Count of received_at has nothing to count for open and cancelled orders and is 17,127 in total, because empty cells are not counted.
Fill rate by warehouse regionwarehouse_regionNoneCalculated field quantity_received / quantity_ordered, as a percentagestatus: received and partialMidwest is lowest at 95.8% and Northeast is highest at 96.7%. Grand Total: 96.1%.
Inventory & Supply Chain dataset →

Flat sales file: 237,537 order lines

sales_lines.csv has one row per order line from January 2023 to December 2025, with the same columns as the ecommerce Data sheet.

TaskRowsColumnsValuesFiltersExpected answer
Item revenue by category, three yearscategoryNoneSum of line_totalorder_status: clear cancelledapparel is highest at 10,070,386.43 and home is lowest at 9,276,323.49. Grand Total: 58,719,861.14.
Item revenue by customer segmentcustomer_segmentNoneSum of line_totalorder_status: clear cancelledconsumer 48,186,775.33; small_business 8,774,916.65; enterprise 1,758,169.16.
More sales data in CSV, Excel, and SQL →
Start here

A first PivotTable, checked

Use the Data sheet of the workforce practice workbook: 6,000 rows, one per employee. Menu names are from Excel for Microsoft 365 on Windows. Excel for Mac and Excel for the web arrange some commands differently.

  • Select any cell in the Data sheet, choose Insert > PivotTable, and place it on a new worksheet.
  • Drag department_name to Rows and employment_status to Columns.
  • Drag employee_id to Values. It is text, so Excel shows Count of employee_id.
  • Check the Grand Total row: 4,975 active, 1,025 terminated, 6,000 in all.
  • Right-click a number, choose Show Values As, then % of Row Total. The terminated column is now an attrition rate: 17.08% overall.
  • To chart it, select a cell in the PivotTable and choose Insert > PivotChart.
Practical guidance

Start with a useful result

Blank cells are not zeros

In the workforce Data sheet, termination_type is empty for the 4,975 active employees and latest_review_score is empty for 781 employees with no review. An empty cell in a Rows field appears as an item named (blank). Count counts only cells that hold a value, and Average skips empty cells, so Average of latest_review_score describes the 5,219 employees who were reviewed, not all 6,000.

Dates group only when they are real dates

Excel can group a date field by month, quarter, and year: right-click a date in the PivotTable and select Group. That works only when the column holds real dates. In the practice workbooks dates are text in the form 2025-07-01, so they do not group. Use the order_month column in the ecommerce sheet, or add a helper column with =DATEVALUE(cell), format it as a date, and refresh.

Distinct count needs the Data Model

Count of order_id on the ecommerce sheet returns 39,922, because it counts order lines. To count orders, select Add this data to the Data Model when you create the PivotTable, then choose Distinct Count in Value Field Settings. The answer is 16,836. Distinct Count is not offered in a PivotTable built without the Data Model. In a version of Excel with the UNIQUE function, =COUNTA(UNIQUE(range)) gives the same number.

A calculated field divides totals, a ratio column does not

A calculated field is a formula you add under PivotTable Analyze > Fields, Items, & Sets > Calculated Field. Excel sums each field first and then applies the formula, which is what a rate needs. On the marketing sheet, the calculated field revenue / spend gives affiliate 6.54. A helper column of revenue / spend on every row, averaged in the PivotTable, gives 8.44, because a day with little spend counts as much as a day with a lot. A PivotTable built on the Data Model does not offer calculated fields, so use a separate PivotTable for them.

Refresh after the data changes

A PivotTable reads a snapshot of the data, called the cache. After you edit the Data sheet or add a helper column, select the PivotTable and choose PivotTable Analyze > Refresh, or right-click it and select Refresh. Format the Data sheet as a table first (Insert > Table) so that new rows and columns are included when you refresh. Some newer versions of Excel can refresh a PivotTable automatically; check before you rely on it.

A Count where you expected a Sum means text

Excel adds a numeric field to Values as Sum and a text field as Count. The practice workbooks store amounts as numbers, so line_total and amount_due sum as expected. The analysis-ready workbooks for the six datasets on this page store decimal columns as text, so a Sum of them is 0 until you convert them, for example with =VALUE(cell) in a helper column.

Where can I get sample data to practice PivotTables in Excel?

Each dataset on this page has a free Excel practice workbook. The Data sheet is one table with a header row, ready for Insert > PivotTable. The six Data sheets run from 6,000 employee rows to 45,237 invoice rows. The tasks on this page name the fields for each area of the PivotTable and give the expected answer.

Do the PivotTable exercises come with answers?

Yes. Every task on this page ends with the expected answer, computed from version 1.0.0 of the workbook, usually a Grand Total and one named item. Each workbook also has its own Tasks sheet with six to eight questions and an Answers sheet, covering formulas such as SUMIFS and AVERAGEIFS as well as PivotTables.

Which dataset is best for a first PivotTable?

Use the workforce attrition workbook. It has 6,000 rows, one per employee, and the first task only counts. Put department_name in Rows, employment_status in Columns, and employee_id in Values. The Grand Total should read 4,975 active, 1,025 terminated, and 6,000 in total. Then show the values as a percentage of the row total to get an attrition rate by department.

Can I use these files to practice pivot charts?

Yes. A PivotChart is a chart drawn from a PivotTable that follows its filters. Good first charts are item revenue by month on the ecommerce sheet, a column chart with six bars, and average rentals by hour on working days on the bike sharing sheet, a line with peaks at hours 8 and 17. In Excel for Windows, select a cell in the PivotTable and choose Insert > PivotChart.

Why does my PivotTable not match the expected answer?

Check four things. The filter: several tasks leave out cancelled orders or void invoices. The aggregation: Count of order_id counts order lines, not orders. The ratio: an average of row-level rates differs from a calculated field that divides totals. And the cache: a PivotTable does not always pick up edits to the Data sheet until you refresh it.

Is there a larger file for PivotTable practice?

Yes. The flat sales file for the ecommerce dataset is one CSV with 237,537 order lines from January 2023 to December 2025 and the same 18 columns as the practice Data sheet. It fits within the Excel worksheet limit of 1,048,576 rows. Item revenue for orders that were not cancelled is 58,719,861.14 across the three years.

From PivotTables to queries you can rerun

Every PivotTable here is a GROUP BY with a filter. Practice the same summaries in SQL, where the definition is written down and repeatable.

Explore free SQL practice