Tabellab

Trial Balance from a GL Export: SUMIFS & the Debits = Credits Check

Lesson 1 of 20Lab

All lessons
  1. Trial Balance from a GL Export: SUMIFS & the Debits = Credits CheckLabFree
  2. Mapping Accounts to Financial Statement Lines with XLOOKUPLab Locked
  3. Bank Reconciliation with Matching Flags: COUNTIFS on Reference and AmountLab Locked
  4. Accounts Receivable Ageing: Days Past Due, Buckets with IFS & a ChartLab Locked
  5. Prepayments & Accruals: a Monthly Release ScheduleLab Locked
  6. Fixed Asset Register: SLN, Accumulated Depreciation, NBV & DBLab Locked
  7. Budget vs Actual: Variance %, Favourable / Unfavourable & Materiality FlagsLab Locked
  8. Month-End Close: Checklist Deadlines with WORKDAY & the Intercompany CheckLab Locked
  9. Allowance for Doubtful Accounts: a Provision Matrix from the Ageing and the Month-End EntryLab Locked
  10. Goods Received Not Invoiced: Accruing for Deliveries without a Supplier InvoiceLab Locked
  11. Payroll Cut-Off and Leave Liability: Accrued Wages and Unused Vacation DaysLab Locked
  12. Inventory at Month End: Count vs Book, Shrinkage and a Slow-Moving ProvisionLab Locked
  13. Revenue Cut-Off: Shipments, Delivery Terms and Invoices around the Period EndLab Locked
  14. Deferred Revenue: Earning Service Plans by the Day with Overlapping Date RangesLab Locked
  15. Bank Loan Schedule: PMT, Interest vs Principal and the Current / Non-Current SplitLab Locked
  16. Foreign-Currency Revaluation at Month End: Open Items, Closing Rates and Unrealised FXLab Locked
  17. Sales-Tax Control Account: Expected vs Charged Tax, Net Payable and the ReconciliationLab Locked
  18. Balance Sheet Reconciliation Tracker: GL vs Support, Unexplained Differences and StatusLab Locked
  19. Cash Flow Statement, Indirect Method: from Net Profit to the Change in Cash (Waterfall Chart)Lab Locked
  20. Final Project: a Month-End Close Dashboard for Quillmark UKLab Locked

You are not signed in — the lab works, but your progress is not saved. Sign up

Lesson 1 of 20 is free. Unlock all 20 hands-on labs, the final exam and your certificate.

Buy course — CHF 9.90
Loading the spreadsheet…

Why every month-end starts with a trial balance

It is the second working day of the month. The controller wants a first trial balance for the new subsidiary by lunchtime, and the only thing the accounting system gives you is a flat general-ledger export: hundreds of journal lines, each with an account number, a date, a description and an amount in either the debit or the credit column. There is no ready-made report, no pivot layout and nobody to ask. This lesson is for accountants, bookkeepers, finance students and analysts who face exactly that situation and want a method that is fast, auditable and repeatable every month.

In the free lab above you play a member of the finance team at Quillmark Distribution Inc., a fictional wholesaler of office supplies. Its new subsidiary, Quillmark Canada Ltd., has just finished its first month of trading. You will turn its GL export into a trial balance with SUMIFS, prove whether total debits equal total credits, and track down the one line that breaks the balance. This article walks through the same case step by step, explains the reasoning behind each formula, and shows the mistakes that cost people hours at month-end.

The skills are deliberately basic in the best sense. A trial balance built from formulas is the foundation for everything that follows in a close: statement mapping, reconciliations, accruals, variance reports. If the trial balance is wrong, every report built on it is wrong, and if it is built by hand, nobody can check it quickly. Get this one right and the rest of the close becomes much calmer.

The core idea: a trial balance is a summary of the ledger

A trial balance is a list of every ledger account with its total debits, total credits and net balance at a cut-off date. It is not a financial statement. It is the working document that sits between the bookkeeping and the statements, and its first job is to confirm that the books are arithmetically in order.

The test relies on double entry. Every journal entry has at least one debit and one credit of equal value. When Quillmark Canada received 50,000 of share capital, the bank account 1000 was debited 50,000 and share capital 3000 was credited 50,000. Add up every debit in the ledger and every credit in the ledger and the two totals must be identical. If they are not, something in the data or in your summary is wrong.

In Excel, summarising a ledger means answering one question many times: what is the total of column D for the rows where column A equals this account? That is precisely what SUMIFS does. Its arguments are the range to add up, followed by pairs of a range to test and a value to test for. For the debits of account 1000 the formula reads =SUMIFS($D$2:$D$21,$A$2:$A$21,A24): add the debit column, but only for rows whose account matches the account number in A24.

Two details make this formula work at scale. First, the dollar signs lock the GL ranges, so when you copy the formula down from D24 to D33, the sum range and criteria range stay fixed while the criterion A24 moves to A25, A26 and so on. Second, the criterion is a cell reference rather than a typed number. That way the trial balance list itself drives the formula, and adding an account to the list automatically gives it a total.

SUMIFS puts the sum range first. The older SUMIF puts it last: =SUMIF($A$2:$A$21,A24,$D$2:$D$21). Both give the same answer for one condition, but SUMIFS lets you add a second condition later, such as a date range for a single period, without rewriting the formula.

From GL export to a checked trial balanceGL export20 journal linesA: account, D/E: Dr/CrSUMIFS per accountdebits → column Dcredits → column ETrial balance10 accountsbalance = Dr − CrCheck totalsROUND(D34−E34,2)=0Balanced?Out of balancedifference 1,480Dr 191,230 / Cr 189,750Find the culpritCOUNTIF(TB list, A2)=0→ account 1110Fix the posting (1110 should be 1100), refresh, and the status turns to Balanced.
Figure 1. The workflow you follow in the lab: summarise the GL with SUMIFS, test debits against credits, then trace the difference back to one journal line.

Worked example: Quillmark Canada’s first month

Here is an extract of the GL export you work with in the lab. Each row is one journal line. Most transactions occupy two consecutive rows: one debit line and one credit line with the same description. The dates are stored as Excel serial numbers and formatted as dates, and the amounts are plain numbers.

RowAccountDescriptionDebitCredit
21000Share capital paid in50,000
33000Share capital paid in50,000
41500Shelving and scanners18,000
51000Shelving and scanners18,000
81100Credit sales, week 1-231,200
94000Credit sales, week 1-231,200
141000Customer receipts22,600
151100Customer receipts22,600
181000Receipt Birchwood Deli1,480
191110Receipt Birchwood Deli1,480
……(20 lines in total)……

Look closely at rows 18 and 19. Birchwood Deli, a customer, paid 1,480. The debit to cash (1000) is correct. The credit, however, was posted to account 1110, which does not exist on Quillmark’s chart of accounts list. It should have gone to accounts receivable, 1100. This kind of slip is common in a new entity: a mistyped account, or an account that someone created in the system but forgot to tell finance about. The point of the lab is that you do not need to know about the error in advance. The formulas will find it.

After you fill in the debit and credit columns with SUMIFS, the trial balance looks like this. Every number below comes straight from the GL data in the lab, so you can compare your own result with it.

AccountNameTotal debits (D)Total credits (E)Balance (F)
1000Cash at bank74,08044,05030,030
1100Accounts receivable31,20022,6008,600
1200Inventory24,50017,4007,100
1500Equipment18,000018,000
2000Accounts payable15,00024,500−9,500
3000Share capital050,000−50,000
4000Sales revenue031,200−31,200
5000Cost of goods sold17,400017,400
6100Rent expense3,20003,200
6200Wages expense7,85007,850
Total191,230189,7501,480

The status cell now says Out of balance: total debits are 191,230 and total credits are 189,750. The difference, 1,480, is a strong clue, because a single misposted line usually produces a difference equal to its own amount. The credit of 1,480 was summed by no SUMIFS formula at all, since no row of the trial balance asks for account 1110. The debit side of that entry is included, the credit side is not, and the trial balance cannot balance.

These are the formulas used in the finished sheet. Enter each one once and copy it down; the only cell that needs typing in every row is the account number in column A, which is already there.

CellFormulaWhat it does
D24=SUMIFS($D$2:$D$21,$A$2:$A$21,A24)All debits posted to account 1000
E24=SUMIFS($E$2:$E$21,$A$2:$A$21,A24)All credits posted to account 1000
F24=D24-E24Net balance, debit positive
D34=SUM(D24:D33)Total debits of the TB
D35=IF(ROUND(D34-E34,2)=0,"Balanced","Out of balance")Status of the debits = credits check
G2 (helper)=COUNTIF($A$24:$A$33,A2)=0TRUE when a GL account is missing from the TB list

TB totals before the fixTotal debits191,230Total credits189,750gapDifference D34 − E34 = 1,480exactly the credit posted to unknown account 1110
Figure 3. The two totals look almost equal, which is why a formula check beats eyeballing. The 1,480 gap matches the Birchwood Deli receipt that was keyed to 1110 instead of 1100.

Notice what the status formula does with ROUND. Excel stores numbers in binary floating point, so a column of amounts with cents can produce a total like 0.0000000001 instead of exactly zero after subtraction. Without rounding, D34-E34=0 might return FALSE for a perfectly balanced ledger. Rounding the difference to two decimals, the precision of the currency, removes that noise and makes the check trustworthy. It is a habit worth copying into every reconciliation you build.

How to do it in Excel, step by step

  1. Open the GL export and check the column layout: account in column A, description in B, date in C, debit in D, credit in E. If the export has one signed amount column instead, split it first with =MAX(0,amount) for debits and =MAX(0,-amount) for credits.
  2. Make sure the account numbers are real numbers, not text. Select column A and look at the status bar: if it shows a Count but no Sum, the accounts are stored as text. Fix them with Data > Text to Columns > Finish, or multiply by 1 in a helper column. Text and numbers do not match each other in SUMIFS.
  3. Below or beside the export, list the accounts of the chart of accounts once each, with name and type. In the lab this list sits in A24:C33.
  4. Click D24 and type =SUMIFS(. Select the debit column D2:D21 and press F4 to lock it as $D$2:$D$21. Type a comma, select A2:A21 and press F4 again. Type a comma, click A24 and leave it unlocked. Close the bracket and press Enter.
  5. Select D24:D33 and press Ctrl+D to fill the formula down. Check one result by hand: filter the GL on account 1200 and confirm that its debits add up to 24,500.
  6. In E24, write the same formula for the credit column: =SUMIFS($E$2:$E$21,$A$2:$A$21,A24), and fill it down to E33.
  7. Let column F show the net balance with =D24-E24. Debit balances come out positive, credit balances negative.
  8. Total the columns in row 34 with =SUM(D24:D33) and the matching formulas for E and F. The shortcut Alt+= (Windows) or Cmd+Shift+T (Mac) inserts a SUM for the cells above.
  9. In D35, write the status: =IF(ROUND(D34-E34,2)=0,"Balanced","Out of balance"). Optionally colour it with Home > Conditional Formatting > Highlight Cells Rules > Text that Contains, using "Out" with a red fill.
  10. If the status says Out of balance, add a helper column next to the GL: in G2 type =COUNTIF($A$24:$A$33,A2)=0 and fill it down. Filter column G on TRUE (Data > Filter, or Ctrl+Shift+L). Every row that remains belongs to an account the TB does not know.
  11. Investigate the flagged line, decide whether the account should be added to the list or the posting corrected, and record the decision. In the lab you type the unknown account number into D36.
Turn the GL export into an Excel Table with Ctrl+T before you write the SUMIFS formulas. The formulas then read =SUMIFS(GL[Debit],GL[Account],A24), and next month you can paste a longer export into the same table without touching a single formula.

Trial balance by account (debit +, credit −)-50,000-25,000025,0001000 Cash at bank30,0301100 Receivables8,6001200 Inventory7,1001500 Equipment18,0002000 Payables-9,5003000 Share capital-50,0004000 Sales revenue-31,2005000 COGS17,4006100 Rent3,2006200 Wages7,850
Figure 2. Column F of the finished trial balance as a chart. Assets and expenses carry debit balances (mint), payables, capital and revenue carry credit balances (peach). The bars do not cancel out exactly: the missing 1,480 is still hiding in account 1110.

Reading the result like an accountant

The chart above is a useful sanity check that experienced accountants run in their heads. Cash, receivables, inventory, equipment and expenses should carry debit balances. Payables, share capital and revenue should carry credit balances. If an asset suddenly shows a credit balance, for example a bank account that is overdrawn or a receivable that has been over-credited, the sign alone tells you where to look. In Quillmark Canada’s case every sign is as expected, which tells you that the imbalance does not come from a reversed posting but from a line that is missing from the summary.

There are only a few ways a trial balance built with SUMIFS can fail to balance, and each leaves a recognisable fingerprint. An account that is missing from the list produces a difference equal to the net amount posted to it, as here. A row where both debit and credit were entered produces no difference, but inflates both totals. A number stored as text is ignored by SUMIFS and creates a difference equal to that amount. A transposition, such as 1,480 typed as 1,840, produces a difference divisible by 9, a classic bookkeeping clue that still works in Excel.

Excel for accountants course: trial balance, reconciliations and month-end workbooks
All 20 labs of this course use the books of one fictional company, Quillmark Distribution Inc., so each month-end task builds on the last.

Common mistakes and how to spot them

  • Ranges not locked. If you forget the dollar signs, the GL range slides down as you copy, and the last accounts miss the first rows of the ledger. Spot it with Ctrl+` (show formulas): every row must refer to $D$2:$D$21.
  • Sum range and criteria range of different sizes. =SUMIFS($D$2:$D$21,$A$2:$A$20,A24) returns #VALUE!. Both ranges must cover exactly the same rows.
  • Accounts stored as text. Exports often deliver "1000" as text. SUMIFS then returns 0 for that account. A green triangle in the corner of the cell or a left-aligned number is the warning sign.
  • Testing the difference without ROUND. A balanced ledger can show "Out of balance" because of a tiny floating-point remainder. Always round to the currency precision before comparing with zero.
  • Hard-coding the account in the formula. =SUMIFS($D$2:$D$21,$A$2:$A$21,1000) works for one row only and breaks when you copy it. Point to the account cell instead.
  • Summing debits minus credits in the debit column. Keep debits and credits in separate columns and calculate the balance in its own column. It makes the TB easier to review and matches the way auditors read it.
  • Forcing the balance. Typing the difference into a "suspense" row makes the status green but hides the error. Find the line, then fix or document it.

Quick reference: functions and shortcuts used

Function / shortcutSyntax or keysUse in month-end work
SUMIFSSUMIFS(sum_range, criteria_range1, criteria1, …)Debit and credit totals per account, per period or per cost centre
SUMIFSUMIF(range, criteria, [sum_range])Older single-condition version, still common in inherited files
SUMSUM(D24:D33)Column totals of the TB
ROUNDROUND(number, 2)Removes floating-point noise before a zero test
IFIF(test, value_if_true, value_if_false)Turns a check into a readable status
COUNTIFCOUNTIF(range, criteria)Finds accounts that exist in the GL but not on the TB list
F4F4 (Windows) / Cmd+T (Mac)Cycles a reference through $A$2, A$2, $A2 and A2
Fill downCtrl+D or double-click the fill handleCopies the first SUMIFS down to all accounts
Paste as valuesCtrl+Alt+V, then VFreezes a GL export before you start working on it
Show formulasCtrl+` (grave accent)Reviews every formula of the TB at once

Real-world uses of this technique

  • New entities and acquisitions. When a company buys a business that runs on a different system, the first data you receive is usually a raw ledger export. A SUMIFS trial balance gives you a usable view on day one.
  • Audit preparation. Auditors often ask for a trial balance that ties back to the ledger. Because every figure is a formula over the export, you can show exactly where each number comes from.
  • Monthly close in small companies. Many small businesses run their accounting in an entry-level package whose reports are limited. Exporting the ledger and summarising it in Excel lets you add your own groupings, checks and comparisons.
  • Period comparisons. Add a date condition to the same formula, for example =SUMIFS($D$2:$D$21,$A$2:$A$21,A24,$C$2:$C$21,"<="&$H$1), and the TB recalculates for any cut-off date you type into H1.
  • Migration checks. When a company moves to a new accounting system, finance teams compare the trial balance from the old system with the opening balances in the new one. The same SUMIFS and difference checks prove that nothing was lost.

What you will build in the rest of this course

This first lab is free. The rest of the course follows Quillmark through a complete month-end close, using the same company and the same kind of real-looking data, with every cell checked as you go.

Mapping Accounts to Financial Statement Lines with XLOOKUP. A trial balance is not yet a balance sheet. You attach every one of 21 ledger accounts to its statement line through a mapping table, summarise the TB by line and prove that the statements balance. It is the step that turns a list of accounts into something a manager can read.

Bank Reconciliation with Matching Flags: COUNTIFS on Reference and Amount. You match the cash book against the bank statement line by line, let Excel list the unmatched items for you and reconcile both balances to the cent, instead of ticking printouts with a pen.

Accounts Receivable Ageing: Days Past Due, Buckets with IFS & a Chart. You calculate how many days each open invoice is overdue, sort them into ageing buckets with IFS, total the buckets with SUMIFS and present the result as a chart for the credit-control meeting.

Prepayments & Accruals: a Monthly Release Schedule. You build a schedule that spreads four prepayments over their months, tracks the prepaid balance and calculates a utilities accrual, then post the month’s journal entries from it.

Fixed Asset Register: SLN, Accumulated Depreciation, NBV & DB. You complete an asset register with straight-line depreciation, accumulated depreciation that stops at the depreciable amount and net book value, plus a declining-balance schedule for a delivery van.

Budget vs Actual: Variance %, Favourable / Unfavourable & Materiality Flags. You turn a raw budget comparison into a report management can act on: percentage variances, a favourable or unfavourable label that knows the difference between revenue and cost lines, a two-condition materiality flag and red highlights.

Month-End Close: Checklist Deadlines with WORKDAY & the Intercompany Check. You convert a close checklist into real due dates with WORKDAY, measure progress, count overdue tasks and test intercompany balances before they are eliminated in consolidation.

Summary

A trial balance built from formulas takes minutes to set up and pays off every month. SUMIFS summarises the ledger per account, locked ranges let one formula serve the whole list, ROUND makes the debits-equals-credits test reliable, and COUNTIF finds the account that slipped through. Most importantly, the difference between the totals is not just an alarm: it is a pointer to the exact line you need to fix.

Now scroll back up and try it yourself in the free lab. Build the debit and credit totals, watch the status cell report the imbalance, and use the clues from this article to name the culprit account. The Coach checks every answer instantly, so you know at once whether your trial balance would survive a review.

Frequently asked questions

How do I make a trial balance in Excel from a general ledger export?

List each account once, then use =SUMIFS(debit column, account column, account) for the debits and the same formula on the credit column for the credits. Subtract credits from debits for the balance and total all columns.

Why does my trial balance not balance in Excel?

The usual causes are an account in the ledger that is missing from your account list, amounts stored as text, ranges that were not locked with $ when copying, or a typing error in the data. The difference between total debits and credits often equals the amount of the problem line.

What is the difference between SUMIF and SUMIFS?

SUMIF handles one condition and puts the sum range last. SUMIFS handles one or many conditions and puts the sum range first, so it is the better choice when you may later add a date or cost-centre condition.

Why should I use ROUND when checking that debits equal credits?

Excel calculates in binary floating point, so totals of amounts with cents can differ by a tiny fraction such as 0.0000000001. Rounding the difference to two decimals before comparing it with zero prevents false alarms.

How can I find accounts in the GL that are missing from my trial balance?

Add a helper column next to the ledger with =COUNTIF(trial balance account list, A2)=0 and filter it on TRUE. Every remaining row uses an account your trial balance does not include.

Should debit balances be positive or negative in a trial balance?

A common convention, used in this course, is debit balances positive and credit balances negative, calculated as debits minus credits. With that convention the balance column of a correct trial balance adds up to zero.

Keep going: Excel for Accountants: Reconciliations, Ledgers & Month-End

This free lab is lesson 1 of 20. Unlock the other 19 hands-on labs, the final exam and your certificate for a one-time CHF 9.90.

  1. Mapping Accounts to Financial Statement Lines with XLOOKUP
  2. Bank Reconciliation with Matching Flags: COUNTIFS on Reference and Amount
  3. Accounts Receivable Ageing: Days Past Due, Buckets with IFS & a Chart
  4. Prepayments & Accruals: a Monthly Release Schedule
  5. Fixed Asset Register: SLN, Accumulated Depreciation, NBV & DB
  6. Budget vs Actual: Variance %, Favourable / Unfavourable & Materiality Flags
  7. Month-End Close: Checklist Deadlines with WORKDAY & the Intercompany Check
  8. Allowance for Doubtful Accounts: a Provision Matrix from the Ageing and the Month-End Entry
  9. Goods Received Not Invoiced: Accruing for Deliveries without a Supplier Invoice
  10. Payroll Cut-Off and Leave Liability: Accrued Wages and Unused Vacation Days
  11. Inventory at Month End: Count vs Book, Shrinkage and a Slow-Moving Provision
  12. Revenue Cut-Off: Shipments, Delivery Terms and Invoices around the Period End
  13. Deferred Revenue: Earning Service Plans by the Day with Overlapping Date Ranges
  14. Bank Loan Schedule: PMT, Interest vs Principal and the Current / Non-Current Split
  15. Foreign-Currency Revaluation at Month End: Open Items, Closing Rates and Unrealised FX
  16. Sales-Tax Control Account: Expected vs Charged Tax, Net Payable and the Reconciliation
  17. Balance Sheet Reconciliation Tracker: GL vs Support, Unexplained Differences and Status
  18. Cash Flow Statement, Indirect Method: from Net Profit to the Change in Cash (Waterfall Chart)
  19. Final Project: a Month-End Close Dashboard for Quillmark UK

Buy course — CHF 9.90 See the full course