Wauvel
Toolkit

SUMIFS: turn a raw QuickBooks export into a P&L with one formula

← All posts
By Blake EkelundJuly 7, 2026 · 8 min read

Export your general ledger from QuickBooks (or Xero, or a bank feed) and what lands in Excel isn't a report — it's a flat list. One row per transaction: a date, an account, an amount, maybe a class or a vendor. Hundreds or thousands of rows. Somewhere in there is your P&L, but it's smeared across every line.

The one formula that turns that pile into a statement is SUMIFS — “sum with conditions.” It adds up only the rows that match the rules you give it, so you can say add every amount where the account is Revenue and the month is June and get one number back. Do that for each line and each period and you've built a P&L that rebuilds itself the moment you paste in fresh data.

The one-line answer: =SUMIFS(Amount, Account, "Revenue", Month, "Jun") — the numbers to add first, then pairs of where-column, must-equal. Add as many pairs as you have conditions. Everything else in this post is detail on that one shape.

The problem: a ledger is a list, not a report

Here's what an export actually looks like — a transaction log, sorted by date, with the account and amount you care about buried in columns you now have to add up by hand:

The raw export
ABCD
1DateAccountMonthAmount
26/03RevenueJun42,000
36/09COGSJun-18,300
46/14RevenueJun61,500
56/21PayrollJun-28,900
66/28RevenueJun80,700
77/02RevenueJul39,400
Every transaction on its own row. Useful for detail, useless as a report — until you can roll it up by account and period.

You could filter to Revenue, eyeball June, and type the total into a summary tab. That works exactly once. Next month the rows change and your hand-typed number is a lie. SUMIFS does the filtering and the adding, live, so the summary is never stale.

SUMIFS, one argument at a time

The syntax reads a little backwards the first time, because the thing you want (the numbers to add) comes first, and the conditions come after in pairs:

  • sum_range — the column of numbers to total. Here, Amount.
  • criteria_range1, criteria1 — a column to test and what it has to equal. Account must be "Revenue".
  • criteria_range2, criteria2, … — repeat for every extra condition. Month must be "Jun". You can stack up to 127 pairs; a row has to pass all of them to be counted.
One condition
B2=SUMIFS(Amount, Account, "Revenue")
AB
1All revenue223,600
SUMIFS adds only the Amount rows where Account equals Revenue — across the whole ledger, no filtering by hand.

Point the criteria at a cell instead of a typed value and the formula becomes a control panel: put the month in B1, reference $B$1, and the whole statement re-reads when you change one cell.

Two conditions: the actual P&L cell

A real P&L cell is the intersection of a line (Revenue) and a period (June) — so it takes two conditions. This is the formula you'll copy across a whole grid of accounts and months:

Account × month
C2=SUMIFS(Amount, Account, "Revenue", Month, "Jun")
ABC
1LinePeriodAmount
2RevenueJun184,200
Two condition pairs — account AND month. This single cell is the building block of the entire statement grid.

Anchor the ranges with $ (so $D:$D and $B:$B don't shift as you fill), leave the account and month references relative so they pick up the row and column headers, and one formula fills the whole matrix. That's the entire trick: a wall of the same SUMIFS, each cell reading its own row label and column label.

Free · no account · no card

Get your 2027 budget built from your QuickBooks — P&L, balance sheet and cash flow, in Excel.

Build my 2027 budget →

The finished statement, built from the list

Fill that formula down the lines and across the months and the flat export becomes a statement that foots and updates itself:

P&L — rolled up
LineJunJulAug
Revenue184,200196,800203,100
Cost of goods(71,400)(76,200)(78,900)
Gross profit112,800120,600124,200
Payroll(58,900)(58,900)(61,300)
Operating expense(31,200)(34,700)(33,800)
Net income22,70027,00029,100
Every figure here is a SUMIFS reading the same ledger. Paste in next month's export and the whole thing re-totals.

The subtotal rows — Gross profit, Net income — are plain arithmetic on the SUMIFS cells above them, not more lookups. That's the whole model: SUMIFS pulls the raw lines up to each P&L line, and simple addition stacks them into subtotals.

The traps that return a wrong number silently

SUMIFS almost never throws an error when it's wrong — it just returns 0, or a number that's a little off, and looks perfectly confident doing it. These are the four that catch people:

  • Text vs. number mismatch. If your account codes came in as text (“4100” the label, not 4100 the number), a numeric criterion won't match and you get 0. Left-aligned values in a column of numbers are the tell.
  • Trailing spaces. "Revenue " with a stray space is not "Revenue". Exports are full of them. Wrap the source column in TRIM once, or clean it on import.
  • Mismatched range sizes. If sum_range is D2:D500 but a criteria range is B2:B499, you get a #VALUE!. Keep every range the exact same height — whole-column references (D:D, B:B) sidestep it entirely.
  • Operators need quotes. To sum amounts over 30 days or above a threshold, the operator goes inside the quotes: ">30", or ">="&B1 when the cutoff lives in a cell.

SUMIFS or a PivotTable?

The honest answer: both, for different jobs. A PivotTable is faster when you're exploring — drag account onto rows, month onto columns, and you've got a cross-tab in ten seconds, no formulas. But it's a snapshot: it doesn't recalculate until you remember to hit Refresh, and you can't drop one cell into a sentence or a chart without it fighting you.

SUMIFS wins when the layout is fixed and needs to stay live — a P&L that always has the same lines in the same order, feeding a dashboard, a forecast, or a board pack. Every cell recalculates the instant the data changes, and each one is a normal cell you can reference anywhere. Reach for the Pivot to find the shape of the data; reach for SUMIFS to build the report you'll reuse every month.

Its two siblings round out the set: COUNTIFS counts the rows that match instead of summing them (how many invoices are 30+ days late), and AVERAGEIFS averages them (average deal size by stage). Same argument shape, different verb.

This is exactly the roll-up Wauvel does for you — we read your ledger and return the statement, already built and narrated, so you don't rebuild the SUMIFS grid every month. See a sample report →

Need your financials for a lender, a buyer or your accountant? Get the free financials pack →

See what an AI CFO says about your own numbers.

$99/mo, everything included. Free for 14 days, no card.

Meet your AI CFO →

Keep reading

ToolkitOctober 5, 2026 · 6 min read

The 13-week cash flow, rebuilt every Monday

Most cash forecasts are built once, admired, and never opened again. The value isn't in the model - it's in the twenty-minute weekly habit of rolling it forward and comparing what you predicted to what happened.

Read it →
ToolkitSeptember 27, 2026 · 8 min read

How to build a small business pro forma a lender will believe

A bank, a landlord, or a seller asks for a pro forma and most owners start from a blank spreadsheet. Start from your last twelve months instead, add the one change you're asking about, and check the number the lender will check first.

Read it →
ToolkitSeptember 9, 2026 · 7 min read

The month-end close that takes four hours, not four days

A slow close is almost never a bookkeeping speed problem - it's a sequencing problem. Here's the order that removes the waiting, the four reconciliations that catch nearly every error, and the rule that decides when the month is actually done.

Read it →
ToolkitSeptember 7, 2026 · 8 min read

Building next year's operating plan (start now, not in December)

An annual plan built in the last week of December is a wish list. Built in September, it is a decision you have time to act on. Here's the order to build one in, how long each layer takes, and the difference between a plan and a forecast.

Read it →
ToolkitSeptember 3, 2026 · 7 min read

The 10 KPIs worth watching weekly (and the 40 that aren't)

Most dashboards fail because they show everything, which is the same as showing nothing. Here are the ten numbers that earn a weekly look for a small business, why each one is on the list, and the test for whether a metric deserves your attention at all.

Read it →
ToolkitAugust 24, 2026 · 7 min read

Recurring, capacity, or funnel: which revenue engine are you?

Almost every business makes money in one of three shapes, and the shape determines which numbers you should be forecasting. Pick yours and you stop guessing at revenue - you start building it from drivers you can actually influence.

Read it →
ToolkitJuly 3, 2026 · 8 min read

Cleaning messy data in Excel: the six functions that do it

Exported data almost never arrives clean — names in three different cases, addresses jammed in one cell, trailing spaces that quietly break your lookups. Here are the six Excel functions that turn a messy paste into data you can actually total, match, and trust.

Read it →
ToolkitJuly 1, 2026 · 7 min read

XLOOKUP vs VLOOKUP vs INDEX/MATCH: which lookup should you use?

The one-line answer is XLOOKUP — but VLOOKUP and INDEX/MATCH still earn their keep, and INDEX MATCH MATCH does something none of the others can. Here's each one, side by side, with the exact moment you'd reach for it.

Read it →
ToolkitJune 26, 2026 · 9 min read

The case of the missing cash: a CFO's afternoon in Excel

A wholesale distributor turns a profit every month and still can't make its credit line breathe. Here's the afternoon a fractional CFO spent cracking it — and the dozen Excel formulas she reached for, what each one does, and exactly when you'd use it.

Read it →