LedgerCleanerfor QuickBooks® Desktop exports

LedgerCleaner › Guides

How-to guide

How to turn a QuickBooks® Desktop general ledger export into an Excel PivotTable

QuickBooks Desktop’s Transaction Detail by Account report is laid out for printing, so Excel can’t pivot it as it stands. Here’s how to turn the export into a flat table you can filter and pivot, with nothing but QuickBooks Desktop and a few Excel formulas.

Published 8 October 2026 · Blyth Brook Industries

Why the raw export won’t pivot

Send a Transaction Detail by Account report to Excel and you get a faithful copy of the printed report, not a table:

A raw QuickBooks Desktop General Ledger export for the made-up Bluebird Bakery Ltd. (SAMPLE): letterhead rows, headings on row 4, account names indented across columns B and C, and Total rows between accounts.
A raw export, using made-up sample data: letterhead in rows 1–3, headings on row 4, account labels in columns B and C, transactions from column E.

The fix is to put the account on every transaction row, throw away everything that isn’t a transaction, and hand Excel a plain table. The steps below do exactly that.

Step 1: Export the report with the right settings

  1. In QuickBooks Desktop, go to Reports › Accountant & Taxes › Transaction Detail by Account. A memorized report built on it works too.
  2. Pick the date range. Year to date is fine.
  3. Customize Report › Display: tick Type, Date, Num, Name, Memo, Debit and Credit. Debit and Credit need to be separate columns rather than a single Amount column. Balance is optional.
  4. Customize Report › Header/Footer: keep Company Name and Report Title ticked.
  5. Leave the accounts indented the way QuickBooks shows them. That indentation is what tells you the account levels.
  6. Click Excel › Create New Worksheet and choose in new workbook. Under Advanced, untick Send header to Page Setup in Excel, so the company name and report title stay in cells A1 and A2.
  7. Save the workbook as Excel Workbook (.xlsx).
Checklist card: 1, Transaction Detail by Account with Debit and Credit as separate columns. 2, keep Company Name and Report Title ticked in Header/Footer. 3, Send to Excel › Advanced: untick “Send header to Page Setup in Excel”. 4, save as .xlsx with the report on the first sheet.
The four settings that matter most.

Step 2: Find the heading row and the account label columns

Open the export and look at its layout before you write any formulas. In the example used on this page it looks like this:

WhereWhat’s there
Rows 1–3, column ACompany name, report title, date range
Row 4The headings: Type, Date, Num, Name, Memo, Debit, Credit, Balance (columns E to L)
Column BTop-level accounts, e.g. 4000 · Revenue, and their Total … rows
Column CSub-accounts, e.g. 4010 · Retail Sales, and their Total … rows
Column DA third level, if your chart of accounts has one
Last rows, column AThe grand TOTAL

Your file may not match letter for letter. QuickBooks sometimes leaves narrow empty columns between the headings, and a chart of accounts with fewer levels uses fewer label columns. Note your own heading row and column letters, and adjust the formulas in the next step to match.

Step 3: Add helper columns that carry each account down

In the first empty columns to the right of the report (M onward in the example), type these headings in row 4 and these formulas in row 5. Then copy the formulas down to the last row of the report.

ColumnHeading (row 4)Formula (row 5, copied down)
MCategory=IF(B5="",M4,IF(LEFT(B5,6)="Total ","",B5))
NSub-account=IF(M5<>M4,"",IF(C5="",N4,IF(LEFT(C5,6)="Total ","",C5)))
OSub-sub-account=IF(N5<>N4,"",IF(D5="",O4,IF(LEFT(D5,6)="Total ","",D5)))
PAccount=IF(O5<>"",O5,IF(N5<>"",N5,M5))
QNet Amount=K5-J5

How they work:

  • Category repeats the last label found in column B, and clears when it reaches that account’s Total row.
  • Sub-account does the same for column C, and starts again whenever the category changes, so a sub-account never leaks into the next category. Sub-sub-account does the same for column D, one level down.
  • Account is the deepest level the line actually sits in. A line posted straight to a parent account gets the parent’s name, so nothing is lost.
  • Net Amount is credit less debit, so income comes out positive and expenses negative. Use =J5-K5 instead if you’d rather see debits as positive.

If your accounts only go two levels deep, leave out Sub-sub-account and use =IF(N5<>"",N5,M5) for Account. If they go four deep, add one more column in the same pattern.

Step 4: Keep only the transaction rows

  1. Select row 4 and turn on Data › Filter.
  2. Open the filter arrow on Type and untick (Blanks). The letterhead, the account headings, every Total row and the grand TOTAL have an empty Type, so only real transactions stay visible.
  3. Select the visible rows from the heading row down and copy them. Excel copies only the rows the filter shows.
  4. On a new sheet, click A1 and use Home › Paste › Paste Values, so the formulas become fixed text and numbers.
  5. Delete the old label columns (A–D in the example) and the Balance column. Balance is a running balance, so adding it up in a pivot gives a meaningless number.

Step 5: Check that dates and amounts are real dates and numbers

Excel exports from QuickBooks Desktop usually arrive with real dates and numbers, but check before you pivot. Dates and numbers line up on the right of the cell by default, and text lines up on the left. If a column has come through as text, select it and run Data › Text to Columns › Finish to convert it in place. Blank Debit or Credit cells are fine.

Step 6: Turn the range into an Excel table

Click anywhere in the data, press Ctrl+T and confirm My table has headers. Then, on the Table Design tab, change the table name to something like Transactions. A table grows when you paste more rows under it, and a PivotTable built on it picks up the new rows when refreshed.

Step 7: Insert the PivotTable and check it against QuickBooks

  1. With a cell in the table selected, choose Insert › PivotTable and put it on a new worksheet.
  2. Drag Category and then Account into Rows. Add Name under them if you want to see payees.
  3. Drag Debit, Credit and Net Amount into Values.
  4. Drag Type into Filters, so you can look at just invoices or just cheques.
  5. If a value shows as “Count of…”, click it, choose Value Field Settings and pick Sum. Excel picks Count when a column contains blanks or text.

Check the result

Before you rely on the pivot, compare it with the original export. For each account, the pivot’s Debit and Credit should equal that account’s Total row in the QuickBooks report. If an account is out, the usual causes are a label column copied down too far or not far enough, or a filter that let a Total row through.

Doing this every month

The method works, but it’s manual: column letters can shift between exports, the formulas have to be copied down again, and every new month or client means another round of filter, copy and paste values. Keep a blank copy of your helper columns so you can paste them into the next export, and always run the totals check above.

The shortcut

If you rebuild these exports every month, LedgerCleaner is a Windows 10/11 app we make that does these steps for you. It reads the indentation, drops the letterhead and Total rows, and writes one workbook with five sheets: Pivot, Quarters, Summary, Transactions and Sources. Account subtotals and the grand total reconcile with the Total rows QuickBooks printed. It reads QuickBooks Desktop exports only (not QuickBooks Online), and the PivotTables need desktop Excel for Windows.

A Quarters PivotTable built from two made-up Bluebird sample ledgers: revenue, cost of goods sold and operating expenses by account, with fiscal quarters across the top.
Output built from two made-up sample ledgers (fiscal year starting in April). Download the sample workbook (.xlsx) and open it in desktop Excel.

Questions

Does this work with a QuickBooks Online export?

Not as written. QuickBooks Online lays out its similar-sounding report differently: headings such as Transaction Type and Memo/Description, usually a single Amount column instead of Debit and Credit, and the account hierarchy shown as group rows rather than indented label columns. The formulas above are for the QuickBooks Desktop layout.

Why are some Sub-account cells blank?

Because that line was posted to the parent account itself rather than to one of its sub-accounts. The Account column repeats the parent, so the line still lands in the right place in the pivot.

Why does my pivot say “Count of Debit”?

Excel defaults to Count when a column contains blanks or text, and Debit and Credit always have blanks. Change it with Value Field Settings › Sum. If it still looks wrong, some amounts may be text: see step 5.

Can I keep the Balance column?

You can keep it in the table for reference, but don’t put it in the pivot’s Values. It’s a running balance, so summing it adds the same money up many times.