skip to content

Excel

Still the most widely used analysis tool: formulas, lookups, pivot tables, charts, and Power Query for repeatable imports. Interviewers ask about it more often than people expect — usually pivots and lookups, plus when a spreadsheet has outgrown itself.

on this pageshow

questions

6

In an Excel PivotTable, why does a numeric field default to Count instead of Sum?

level: juniorimportance: must knowfreq 60%

answer

  1. the caption is telling you something
  2. Excel inspected the column, not the format
  3. one bad cell decides the whole column
  4. left-aligned values are a clue
  5. switching the setting can hide the real problem

basics

~20 s

A PivotTable uses Sum only when every cell in that source column is numeric. One blank or one number stored as text makes it fall back to Count. Fix the source column and refresh rather than just switching the setting.

solid answer

~50 s

When you drop a field into the Values area, Excel inspects the source column: all-numeric gets **Sum**, anything else gets **Count**. So "Count of Revenue" is a message about your data — there is at least one blank cell or one value that looks numeric but is stored as text, typically from a CSV or a web paste with a trailing space or a non-breaking space. The dangerous fix is to change Value Field Settings to Sum and move on, because `Sum` **ignores text cells silently**: the total then looks right and is quietly short by every text-stored row. The real fix is in the source — convert the column to a genuine number (`Text to Columns`, a `VALUE()` helper column, or an explicit type change on import), then refresh the PivotTable. `ISNUMBER()` on a suspect cell, or comparing `COUNT` with `COUNTA`, tells you how many rows are affected.

code

text · 8 lines
text
-- source column "amount" after a CSV import
1200        <- number
 950        <- text: leading non-breaking space
(blank)
1100        <- number

-- Values area shows: Count of amount = 3
-- switch it to Sum and you get 2300, not 3250

go deeper

for a junior

Recall that Excel defaults to Count when the source column is not entirely numeric, and know how to check a cell with ISNUMBER. Be able to say where text-stored numbers come from — CSV and web pastes.

for a middle

Explain why simply switching the aggregation to Sum is dangerous: Sum skips text cells silently, so the total is short with no error. Describe a repeatable fix applied at import rather than by hand.

for a senior

Talk about preventing the class of bug: type columns on ingest, source PivotTables from Excel Tables so ranges grow, and add a reconciliation check that compares COUNT with COUNTA before anyone reads the report.

for a principal

Frame it as a data-contract problem. If a monthly pack depends on a human noticing a caption say Count instead of Sum, the control is the person; decide whether that report should be reading typed data from a modelled source instead.

## What the Values area actually decides A PivotTable's Values area needs an aggregation for each field. Excel picks the default by looking at the underlying source column, not at the cell formatting: if every populated cell holds a genuine number it chooses **Sum**; if it finds text, or the column has blanks, it falls back to **Count**, which is the only aggregation that is meaningful for anything. So the caption "Count of Revenue" is diagnostic. It is Excel telling you the column is not what you think it is. ## Numbers stored as text The usual culprit is a value that *looks* numeric and is not. Sources: - CSV or web pastes with a trailing space, or a **non-breaking space** (`CHAR(160)`) that `TRIM` does not remove. - Exports where a currency symbol, thousands separator or parentheses for negatives came through as characters. - A column that was formatted as Text before the values were typed, so every entry was stored as a string. - Leading apostrophes added by someone protecting an ID. Tells: text is left-aligned by default while numbers are right-aligned; a small green triangle often appears in the corner; `=ISNUMBER(A2)` returns FALSE; and `COUNT(range)` (numbers only) is lower than `COUNTA(range)` (non-empty cells). ## Blanks A column of otherwise clean numbers with empty cells in it also triggers Count. That is worth knowing because the column genuinely is numeric and no cleaning is needed — you simply switch the aggregation to Sum via Value Field Settings and the total is correct, since Sum treats blanks as nothing. This is why "just change it to Sum" is right about half the time and catastrophic the other half. You have to know which case you are in before you change the setting. ## Why switching to Sum can hide the problem `Sum` skips non-numeric cells rather than erroring on them. If 200 of 10,000 rows are text-stored numbers, switching the aggregation gives you a total that is confidently wrong — no error, no warning, just a number that is short by those 200 rows. Nobody notices until it is reconciled against another system. This is the single most common way a spreadsheet report ships a wrong number. ## Fixing the source properly Options, roughly in order of durability: 1. **Fix it at import.** Load the file through `Data > Get Data > From Text/CSV` and set the column's type explicitly. Repeatable, and it survives the next refresh. 2. **Text to Columns.** Select the column, `Data > Text to Columns`, Finish. Excel re-parses each cell and converts clean text-numbers in place. 3. **A helper column.** `=VALUE(SUBSTITUTE(TRIM(A2), CHAR(160), ""))` strips ordinary and non-breaking spaces before converting. Use this when the junk characters vary. 4. **Paste Special multiply by 1.** Type 1 in a spare cell, copy it, select the column, Paste Special > Multiply. Forces numeric conversion. After any of these, the PivotTable will not change until you **Refresh** — it reads from a cached snapshot of the source, not from the cells live. ## The neighbouring refresh trap While you are here, the other classic: you appended 500 rows below the source data, hit Refresh, and the pivot ignores them. That is because the PivotTable's source is a fixed range like `Sheet1!$A$1:$D$5000` that does not grow. Convert the source to an **Excel Table** (`Ctrl+T`) and point the PivotTable at the Table name; structured references expand automatically as rows are appended, so Refresh picks up new data forever. ## What an interviewer is really testing This question is a proxy for "do you check your data before you trust a total". The strong answer names the cause (mixed types or blanks), names the trap (Sum silently skips text), and names a repeatable fix (type the column at import, not by hand each month).

  • You switched the field to Sum and the total dropped below the correct figure — what happened?
    Sum silently ignores cells whose numbers are stored as text, so every such row contributes zero. Count was including them, which is why the two disagree. The gap between `COUNT` and `COUNTA` over the source column tells you how many rows are being dropped; convert them to real numbers and refresh.
  • You appended 500 rows to the source and clicked Refresh, but the PivotTable ignores them — why?
    The PivotTable's source is a fixed cell range that does not grow when rows are appended below it. Convert the source to an Excel Table with Ctrl+T and repoint the PivotTable at the Table name — structured references expand automatically, so every future Refresh includes new rows without anyone editing the range.
  • How do you tell a genuinely numeric cell from a number stored as text?
    `=ISNUMBER(A2)` is the definitive check. Visually, numbers right-align by default and text left-aligns, and Excel often shows a green triangle on text-stored numbers. Across a column, compare `COUNT` (numeric cells only) with `COUNTA` (non-empty cells) — any difference is the count of text-stored or otherwise non-numeric values.

saying these in an interview costs you the question

  • Just switch Value Field Settings to Sum and move on
  • Claims blank cells cannot affect which aggregation Excel picks
  • Assumes text-stored numbers behave like numbers because they look identical
  • Believes Refresh always picks up rows appended below the source
  • Uses TRIM alone to clean imports, missing non-breaking spaces

context

open as a page

In Excel, what does XLOOKUP do that VLOOKUP cannot?

level: juniorimportance: must knowfreq 70%

basics

~20 s

XLOOKUP takes a separate lookup array and return array, so it can return values to the left of the key, defaults to exact match, and accepts a built-in not-found value. VLOOKUP scans only the first column and returns by column number.

open as a page

In Excel, why do IDs like 00123 or SEP-1 change when you open a CSV?

level: middleimportance: should knowfreq 45%

basics

~20 s

A CSV carries no types, so Excel guesses per value: 00123 parses as the number 123, SEP-1 as a date, and long digit strings keep only 15 significant digits. Import through Get Data with the column typed as Text instead.

open as a page

When a business-critical Excel workbook becomes a production pipeline, what breaks first?

level: seniorimportance: should knowfreq 50%

basics

~20 s

Correctness fails long before performance does. With no diff, no review and no tests, hardcoded plugs and drifted formulas ship wrong numbers silently, while a manual refresh ritual known to one person becomes the real single point of failure.

open as a page

How do you decide which parts of a team's Excel reporting to replace with a BI tool?

level: principalimportance: should knowfreq 30%

basics

~20 s

Replace what repeats on a schedule, is shared across teams, or carries a definition others depend on. Leave ad-hoc exploration, what-if modelling and human judgment inputs in Excel, give those inputs a governed home, and never remove the export path.

open as a page

In Excel, what does the Power Pivot Data Model add that a plain PivotTable cannot do?

level: middleimportance: nice to knowfreq 35%

basics

~10 s

The Data Model relates several tables on shared keys instead of flattening them with lookups, supports DAX measures, offers a true Distinct Count aggregation, and holds far more rows than the 1,048,576-row worksheet grid.

open as a page