PivotTables, Power Query and Data Cleaning in Excel: Practice Questions and Answers [Free PDF]
Proficiency in Excel PivotTables and Power Query separates slow manual reporting from automated FP&A and corporate finance workflows tested in exams, FMVA/CFA prep, university courses, and finance interviews. This study guide provides 30 structured Q&As and 15 MCQs covering structured Excel Tables (Ctrl+T), PivotTable layout and calculated fields, slicers and timelines, Power Query ETL (unpivot, merge, append, split), text-cleaning formulas, and data validation.
This is Chapter 3 of 16 (Module 1: Excel Foundations & Data Modeling for Business · Beginner) in our Financial Modeling & Excel course. Review Lookup Functions: XLOOKUP, VLOOKUP, INDEX-MATCH and Dynamic Arrays first, or continue with Financial Modeling Best Practices, Structure and Error Checking afterwards.
Structured Excel Tables and Data Preparation
Q1. What is a structured Excel Table (Ctrl+T), and why should every PivotTable and Power Query source start as one?
Pressing Ctrl + T converts a static range of rows and columns into an official Excel Table (an intelligent database object with a unique name such as SalesData). Finance teams always format raw ERP exports as Excel Tables before building PivotTables or Power Query pipelines for four reasons:
- Auto-expanding ranges: Adding new monthly rows at the bottom automatically expands the table, so clicking Refresh updates connected PivotTables and charts without editing source ranges.
- Auto-filling formulas: Entering a formula in one cell of a calculated column copies it cleanly down all 50,000 rows automatically.
- Structured references: Formulas use readable column names like
=SUM(SalesData[Revenue])instead of brittle cell coordinates likeD2:D50000. - Persistent headers: Column headers remain visible in the Excel column bar as you scroll down large general ledger extracts.
Q2. How do structured table references work in Excel formulas?
Structured references refer to table columns by name rather than letter-number coordinates. Suppose your Excel Table is named GL_Transactions with columns Department, Account, and Amount:
- Same-row calculation inside the table:
=[@Revenue]-[@COGS]uses the@symbol to indicate the current row (implicit intersection). - External summary formula:
=SUMIFS(GL_Transactions[Amount], GL_Transactions[Department], "Marketing")dynamically includes every future row appended to the table.
Always rename default tables (Table1, Table2) to meaningful names via the Table Design tab so formulas stay self-documenting.
Q3. What are the core rules of “tidy” (tabular) financial data required before building a PivotTable?
PivotTables and Power Query expect normalized, database-style tables. Before summarizing an accounting export, verify five structural rules:
- Single header row: Every column must have a unique, non-blank header in one row (no two-row stacked headers).
- No merged cells: Merged cells break sorting, filtering, and PivotTable grouping.
- No blank rows or subtotal rows: Remove embedded quarterly subtotals or spacer rows so records are not double counted.
- One data type per column: Keep dates as true Excel dates and currency amounts as pure numbers (never mix “TBD” text into a revenue column).
- Long (tall) format, not wide: Store months in a single
Monthcolumn rather than 12 separate columns (JanthroughDec) whenever possible.
Q4. How do you remove duplicate records safely without corrupting valid financial transactions?
Excel’s Data > Remove Duplicates deletes identical rows permanently, so always inspect which columns define a true duplicate first. For instance, two $500 invoices for the same customer on the same day might be legitimate separate orders if their Invoice_ID differs.
- Best practice: Select only the unique primary key column(s) (such as
Invoice_IDorTransaction_ID) in the Remove Duplicates dialog rather than checking every column indiscriminately. - Audit first: Before deleting, flag duplicates non-destructively using Conditional Formatting (Highlight Cells Rules > Duplicate Values) or
=COUNTIF($A$2:$A$1000, A2)>1, or perform deduplication inside Power Query so the raw source file stays untouched.
Q5. How does Data Validation prevent bad inputs in FP&A templates and departmental budget sheets?
Data > Data Validation restricts what users can type into input cells, eliminating typos (like “North America” vs “NA” vs “US”) that fragment PivotTable summaries.
- Dropdown lists: Allow = List, pointing to a clean reference range (or dynamic
UNIQUEspill range like=$G$2#) for Cost Center, Region, or Scenario Selection. - Numeric bounds: Allow = Decimal between
0and1to prevent a user from typing15instead of15%for a growth rate. - Date bounds: Restrict transaction dates to the current fiscal year (e.g.,
1/1/2026to12/31/2026).
Configure the Error Alert style to Stop to block invalid entries outright, or Warning to allow overrides with confirmation.
PivotTable Architecture, Calculated Fields, and Slicers
Q6. What are the four layout areas of an Excel PivotTable, and how does each shape a financial report?
A PivotTable summarizes tens of thousands of transaction rows into a cross-tabulated report by dragging fields into four quadrants of the PivotTable Fields pane.
| PivotTable Area | Role in Report | Typical Finance Fields | Visual Placement |
|---|---|---|---|
| Rows | Groups records vertically into categories | Department, GL Account, Customer, Product Line | Left-hand row labels |
| Columns | Splits categories horizontally across periods or segments | Fiscal Year, Quarter, Region, Scenario (Actual vs Budget) | Top column headers |
| Values | Aggregates numeric metrics (Sum, Count, Average, % of Total) | Revenue ($), EBITDA ($), Units Sold, Headcount | Center data matrix |
| Filters | Applies high-level page filters to the entire report | Legal Entity, Currency, Active/Inactive Status | Above the PivotTable |
Q7. Why does a PivotTable sometimes default to “Count of Revenue” instead of “Sum of Revenue,” and how do you fix it?
Excel defaults a field in the Values area to Count instead of Sum whenever the source column contains even a single blank cell or text value (such as “N/A”, “-“, or a number stored as text).
Quick fix: Click the field in the Values pane > Value Field Settings > change Summarize Values By from Count to Sum, and set Number Format to Currency or Accounting. Root-cause fix: Clean the source column in Power Query (replace blanks/text with 0 and enforce Decimal Number type) so every future PivotTable defaults to Sum automatically.
Q8. How do PivotTable “Show Values As” options compute vertical analysis, horizontal variance, and running totals?
Right-clicking any value cell and choosing Show Values As adds analytical views without writing a single worksheet formula:
- % of Column Total: Creates instant common-size income statements or regional revenue mix percentages.
- % Difference From (Previous Period): Computes Year-over-Year (YoY) or Quarter-over-Quarter (QoQ) revenue growth rates automatically.
- Running Total In: Builds Year-to-Date (YTD) cumulative revenue or cash burn across months.
- Rank Largest to Smallest: Ranks top-performing SKUs, branches, or sales reps dynamically.
You can drag the same Revenue field into the Values area twice: display the first instance as dollars ($) and the second instance as % of Column Total.
Q9. How do Calculated Fields work in PivotTables, and what is their most common pitfall with ratios and margins?
A Calculated Field (PivotTable Analyze > Fields, Items, & Sets > Calculated Field) creates a new metric derived from existing PivotTable fields. Crucially, Excel calculates the formula on the summed totals of each field first, which is actually correct for weighted ratios like Gross Margin:
= (Revenue - COGS) / Revenue
The pitfall: Calculated Fields fail on row-level products (such as = Units * Unit_Price), because Excel computes SUM(Units) * SUM(Unit_Price) instead of summing each row’s product, massively inflating revenue! Always compute row-level multiplications (Line_Revenue = Units * Price) in the source table or Power Query, and reserve PivotTable Calculated Fields for ratios and variances (Gross Margin %, Budget Variance).
Q10. How do Slicers and Timelines upgrade PivotTables into interactive executive dashboards?
Slicers (for categorical fields like Region, Product Line, or Business Unit) and Timelines (specifically for true Excel Date fields, allowing drag-and-drop filtering by Years, Quarters, Months, or Days) provide visual, one-click filter controls.
Their real power comes from Report Connections (right-click a Slicer > Report Connections): a single Slicer can control multiple PivotTables and PivotCharts simultaneously across a dashboard tab, provided those PivotTables share the same underlying Pivot Cache (data source).
Q11. What is the GETPIVOTDATA function, and when should you keep it versus turn it off?
When you type = and click a cell inside a PivotTable, Excel generates a formula like =GETPIVOTDATA("Revenue", $A$3, "Region", "US", "Year", 2026) instead of =B5.
- When to keep it: Building executive summary tables that pull specific metrics from a PivotTable. Even if the PivotTable is re-sorted, filtered, or refreshed with new rows,
GETPIVOTDATAstill pulls the exact “US / 2026” revenue cell safely (and you can replace hardcoded text like"US"with a cell reference like$A10). - When to turn it off: If you want to drag standard relative cell formulas across a PivotTable grid. Disable automatic generation via PivotTable Analyze > Options dropdown > uncheck Generate GetPivotData.
Q12. How do you group dates by quarters and years or bucket invoice aging periods in a PivotTable?
Right-click any date cell in the Rows or Columns area and select Group to roll daily transactions up into Years, Quarters, and Months automatically without adding helper columns to the raw data.
For numeric bucketing, such as Accounts Receivable (AR) aging or deal-size tiers, right-click a numeric field (e.g., Days_Overdue) in Rows, select Group, and set Starting at 0, Ending at 120, By 30 to generate clean 30-day buckets (0-29, 30-59, 60-89, 90-119, >120).
Power Query ETL: Unpivot, Merge, Append, and Automation
Q13. What is Power Query (Get & Transform Data), and how does it automate monthly financial close workflows?
Power Query (Data tab > Get & Transform Data) is Excel’s built-in ETL (Extract, Transform, Load) engine. It connects to CSVs, folders of monthly ERP exports, databases, PDFs, or web tables, records every cleaning transformation as a repeatable sequence of Applied Steps (written behind the scenes in the M language), and loads the clean output directly to an Excel Table or PivotTable.
Instead of spending 4 hours every month manually deleting blank rows, splitting account codes, and copying formulas when new actuals arrive, an FP&A analyst drops the new monthly CSV into a folder and clicks Data > Refresh All (Ctrl + Alt + F5) to execute the entire pipeline in seconds with zero manual error.
Q14. What does Unpivot Columns do in Power Query, and why is it essential for finance exports?
Accounting systems (like NetSuite, QuickBooks, or SAP) frequently export budgets or P&L schedules in a wide cross-tab layout: Column A is Account Name, and Columns B through M are Jan, Feb, …, Dec. You cannot easily slice by Quarter or plot a single time-series PivotTable from 12 separate month columns.
Selecting the static ID columns (such as Account and Department) and choosing Transform > Unpivot Other Columns collapses the 12 month columns into two tidy columns: Attribute (renamed to Month) and Value (renamed to Amount). Using Unpivot Other Columns is especially powerful because when Year 2 months are added later, Power Query unpivots the new columns automatically on refresh.
Q15. What is the difference between Merge Queries and Append Queries in Power Query?
Analysts frequently confuse Merge and Append during data-modeling interviews, even though they operate in opposite directions.
| Operation | Direction | Excel / SQL Equivalent | Financial Modeling Example |
|---|---|---|---|
| Merge Queries | Horizontal (adds columns) | XLOOKUP / SQL JOIN | Joining a Sales_Ledger table with a Chart_of_Accounts lookup table on Account_ID |
| Append Queries | Vertical (stacks rows) | Copy-paste below / SQL UNION ALL | Stacking Q1_Actuals, Q2_Actuals, Q3_Actuals, and Q4_Actuals into one annual table |
For Append Queries, column header names must match exactly (case-sensitive in Power Query); mismatched headers create extra null-filled columns.
Q16. Which Join Kind should you choose when using Merge Queries in Power Query?
Power Query offers six SQL-style join types, with three dominating finance workflows:
- Left Outer (default): Keeps all rows from the primary (left) transaction table and brings in matching attributes from the lookup (right) table. Missing keys return
null(just likeXLOOKUP). - Inner Join: Keeps only rows that match in both tables (useful for isolating active accounts present in both actuals and budget).
- Left Anti Join: Keeps only rows from the left table that have no match in the right table. Auditors love Left Anti joins for instantly spotting unmapped GL accounts or orphan invoices during month-end reconciliation.
Q17. How do Split Column, Change Type, and Group By work inside Power Query?
Three everyday Power Query transforms replace dozens of fragile worksheet formulas:
- Split Column by Delimiter: Splits a combined ERP string like
"US-4100-SaaS"by hyphen (-) into three clean columns:Region,GL_Code, andProduct_Line. - Change Type (Using Locale): Fixes international date and number conflicts (for example, converting UK
DD/MM/YYYYCSV exports into USMM/DD/YYYYdates cleanly via Using Locale). - Group By: Pre-aggregates millions of raw transaction rows (e.g., summing
RevenuebyCustomerandMonth) before loading to Excel, dramatically shrinking workbook file size.
Q18. How can Power Query automatically combine an entire folder of monthly CSV files?
Choose Data > Get Data > From File > From Folder, point to the directory containing monthly exports (e.g., 2026-01.csv, 2026-02.csv, 2026-03.csv), and click Combine & Transform Data.
Power Query uses the first file as a template, appends every CSV in the folder vertically, and retains the Source.Name filename column (so you can even extract the period date from the filename). Next month, simply drop 2026-04.csv into the folder and click Refresh All.
Q19. When should you load a Power Query result to “Only Create Connection” (or the Data Model) instead of a worksheet?
Via Close & Load To…, you control where Power Query writes its output:
- Table (Worksheet): Use when you need to inspect rows directly or feed standard Excel formulas (under ~100,000 rows).
- Only Create Connection: Use for intermediate staging queries (like individual regional tables before an Append) so you do not bloat the workbook with duplicate tabs.
- Add this data to the Data Model (Power Pivot): Use for datasets exceeding Excel’s 1,048,576-row worksheet limit or when linking multiple tables via relationships for PivotTables and DAX measures.
Q20. Compare Power Query vs Excel Formulas for repeatable data-cleaning tasks.
Knowing when to reach for Power Query versus worksheet formulas is a hallmark of modern FP&A maturity.
| Dimension | Worksheet Formulas | Power Query (ETL) |
|---|---|---|
| Best suited for | Dynamic 3-statement models, DCFs, live scenario analysis | Importing, reshaping, merging, and cleaning raw ERP/CRM exports |
| Recalculation behavior | Instant, live on every cell edit | On-demand via Refresh All (Ctrl + Alt + F5) |
| Row capacity | Up to 1,048,576 rows (slows down above ~100k complex rows) | Millions of rows when loaded to Data Model |
| Audit trail | Cell-by-cell formula inspection | Ordered, named list of Applied Steps |
| Unpivoting & combining folders | Complex or impractical | Built-in, 2-click native operations |
Text Cleaning Functions and Data Hygiene
Q21. What is the difference between TRIM and CLEAN when sanitizing ERP or web-scraped data?
Raw exports from legacy accounting software or websites frequently contain invisible characters that break XLOOKUP and SUMIFS:
- TRIM(text): Removes all leading and trailing spaces and collapses multiple internal spaces down to a single space (e.g.,
" Acme Corp "becomes"Acme Corp"). - CLEAN(text): Strips the first 32 non-printing ASCII control characters (such as hidden line breaks
CHAR(10)or carriage returns).
Nesting them as =TRIM(CLEAN(A2)) solves most text hygiene issues. If web-copied data contains non-breaking spaces (CHAR(160)), which TRIM ignores, wrap with SUBSTITUTE: =TRIM(SUBSTITUTE(A2, CHAR(160), " ")).
Q22. How do LEFT, MID, RIGHT, and LEN parse structured financial codes like GL accounts or ticker symbols?
Fixed-width strings (such as cost-center code "US-4100-2026" in cell A2) are easily parsed with Excel’s classic text functions:
- LEFT(A2, 2): Extracts the first 2 characters (
"US"). - MID(A2, 4, 4): Starts at character 4 and extracts 4 characters (
"4100"). - RIGHT(A2, 4): Extracts the last 4 characters (
"2026"). - LEN(A2): Returns total string length (
12), useful for spotting hidden trailing spaces whenLEN("AAPL ")returns5instead of4.
For variable-length strings, pair LEFT or MID with FIND or SEARCH (where FIND is case-sensitive and SEARCH is case-insensitive).
Q23. How do TEXTSPLIT, TEXTBEFORE, and TEXTAFTER modernize text parsing in Microsoft 365?
Modern Excel replaces convoluted LEFT/MID/FIND nests with three intuitive delimiter-based functions:
- TEXTBEFORE(A2, “-“): Returns everything before the first hyphen in
"US-4100-SaaS"("US"). - TEXTAFTER(A2, “-“, -1): Using instance number
-1returns everything after the last hyphen ("SaaS"). - TEXTSPLIT(A2, “-“): Splits
"US-4100-SaaS"across three adjacent columns automatically as a dynamic array spill.
Q24. How do TEXTJOIN, CONCAT, and the & operator combine fields into clean chart titles or unique lookup keys?
Combining text and dynamic values lets analysts build self-updating model headers and composite keys:
- Ampersand (
&) with TEXT:="FY"&B2&" Revenue: "&TEXT(C2, "$#,##0.0,,""M""")produces"FY2026 Revenue: $142.5M". Wrapping numbers inTEXT(value, format_text)preserves currency and percentage formatting inside concatenated strings. - TEXTJOIN(delimiter, ignore_empty, text1, …): Joins an entire range with a separator while skipping blanks automatically, e.g.,
=TEXTJOIN(", ", TRUE, A2:A5).
Q25. How do you convert numbers stored as text (green triangle error) back into real numeric values?
CSV imports often store dollar figures or account numbers as text strings, causing SUM to ignore them and XLOOKUP to return #N/A. Four fast fixes:
- VALUE or double unary in a formula:
=VALUE(A2)or=--A2. - Paste Special Multiply: Copy an empty cell (or a cell containing
1), select the text-number column, and choose Paste Special > Multiply (or Add 0). - Text to Columns shortcut: Select the column, go to Data > Text to Columns > Finish to force Excel to re-parse the column as General numbers.
- Power Query Change Type: Set column data type to Decimal Number or Whole Number for permanent automation.
Q26. Summarize the essential Excel text-cleaning functions for business analysts.
Keep these text functions ready for rapid data hygiene during case studies and monthly reporting.
| Function | Syntax Example | Input Example | Output |
|---|---|---|---|
TRIM | =TRIM(A2) | " US East " | "US East" |
CLEAN | =CLEAN(A2) | "Line1
Line2" | "Line1Line2" |
TEXTSPLIT | =TEXTSPLIT(A2, "-") | "US-4100-SaaS" | "US" | "4100" | "SaaS" |
TEXTBEFORE | =TEXTBEFORE(A2, "@") | "cfo@acme.com" | "cfo" |
PROPER | =PROPER(A2) | "ACME CORP" | "Acme Corp" |
VALUE | =VALUE(A2) | "$1,250.50" (text) | 1250.5 (number) |
Q27. When is Flash Fill (Ctrl+E) helpful for quick data cleanup, and what is its main limitation?
Flash Fill (Ctrl + E) detects a text-extraction or formatting pattern from one or two manual examples you type in an adjacent column (such as extracting last names or reformatting phone numbers) and fills the entire column automatically.
Main limitation: Flash Fill outputs static hardcoded values, not dynamic formulas. If the source column updates next month, Flash Fill results will not recalculate. Use Flash Fill only for one-off ad-hoc cleanups; use TEXTSPLIT or Power Query for recurring financial reports.
Q28. How do you use Text to Columns safely without overwriting adjacent financial data?
Data > Text to Columns splits a single column into multiple columns by a delimiter (comma, tab, hyphen) or fixed width. Because it writes into the columns immediately to the right, it will overwrite existing data unless you insert enough blank helper columns first (or specify a different Destination cell in Step 3 of the wizard).
In Step 3, you can also explicitly set a column’s format to Text to preserve leading zeros in ZIP codes, GL account numbers, or CUSIP identifiers (such as "00412").
Q29. How do you standardize inconsistent category spellings (e.g., “USA”, “U.S.”, “United States”) before building a PivotTable?
Inconsistent spellings split one market into three separate PivotTable rows. The cleanest scalable workflow is a Mapping Table:
- Create a small two-column lookup table (
Raw_NametoStandard_Name) mappingUSA,U.S., andUnited Statesall toUS. - Join it to your raw data via Power Query Merge Queries (Left Outer join) or an
XLOOKUPcolumn in your Excel Table. - Build your PivotTable using the standardized column so new monthly exports map cleanly without repeated Find & Replace work.
Q30. What is a Pivot Cache, and why does refreshing one PivotTable affect other PivotTables built from the same source?
A Pivot Cache is a hidden, memory-optimized snapshot of your source data that Excel stores inside the workbook so PivotTables can slice and filter instantaneously without re-querying raw cells on every click.
When multiple PivotTables share the same Pivot Cache, refreshing one refreshes all of them simultaneously, and a single Slicer can filter all of them via Report Connections. However, if you edit the raw source table, you must click Refresh (Alt + F5) or Refresh All (Ctrl + Alt + F5) because PivotTables do not recalculate automatically like worksheet formulas.
Quick Revision Points
- Always format raw datasets as structured Excel Tables (Ctrl+T) so PivotTables, Power Query, and SUMIFS formulas auto-expand when new monthly rows are added.
- Maintain tidy tabular data: one header row, no merged cells, no embedded subtotal rows, consistent column data types, and long (unpivoted) time periods.
- Use PivotTable Calculated Fields for weighted ratios like Gross Margin % (=(Revenue-COGS)/Revenue), never for row-level multiplications like Units * Unit_Price.
- Remember Power Query’s core distinction: Merge Queries joins columns horizontally (like XLOOKUP/SQL JOIN), while Append Queries stacks rows vertically (like SQL UNION).
- Use Unpivot Other Columns in Power Query to reshape wide 12-month budget sheets into tidy long tables that update automatically when new months arrive.
- Combine TRIM, CLEAN, SUBSTITUTE(CHAR(160)), TEXTSPLIT, and VALUE to eliminate invisible spaces and text-stored numbers that break lookups and sums.
