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.
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.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.
| Row | Account | Description | Debit | Credit |
|---|---|---|---|---|
| 2 | 1000 | Share capital paid in | 50,000 | |
| 3 | 3000 | Share capital paid in | 50,000 | |
| 4 | 1500 | Shelving and scanners | 18,000 | |
| 5 | 1000 | Shelving and scanners | 18,000 | |
| 8 | 1100 | Credit sales, week 1-2 | 31,200 | |
| 9 | 4000 | Credit sales, week 1-2 | 31,200 | |
| 14 | 1000 | Customer receipts | 22,600 | |
| 15 | 1100 | Customer receipts | 22,600 | |
| 18 | 1000 | Receipt Birchwood Deli | 1,480 | |
| 19 | 1110 | Receipt Birchwood Deli | 1,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.
| Account | Name | Total debits (D) | Total credits (E) | Balance (F) |
|---|---|---|---|---|
| 1000 | Cash at bank | 74,080 | 44,050 | 30,030 |
| 1100 | Accounts receivable | 31,200 | 22,600 | 8,600 |
| 1200 | Inventory | 24,500 | 17,400 | 7,100 |
| 1500 | Equipment | 18,000 | 0 | 18,000 |
| 2000 | Accounts payable | 15,000 | 24,500 | −9,500 |
| 3000 | Share capital | 0 | 50,000 | −50,000 |
| 4000 | Sales revenue | 0 | 31,200 | −31,200 |
| 5000 | Cost of goods sold | 17,400 | 0 | 17,400 |
| 6100 | Rent expense | 3,200 | 0 | 3,200 |
| 6200 | Wages expense | 7,850 | 0 | 7,850 |
| Total | 191,230 | 189,750 | 1,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.
| Cell | Formula | What 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-E24 | Net 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)=0 | TRUE when a GL account is missing from the TB list |
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
- 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. - 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.
- 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.
- 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. - 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.
- 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. - Let column F show the net balance with
=D24-E24. Debit balances come out positive, credit balances negative. - 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. - 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. - If the status says Out of balance, add a helper column next to the GL: in G2 type
=COUNTIF($A$24:$A$33,A2)=0and 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. - 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.
=SUMIFS(GL[Debit],GL[Account],A24), and next month you can paste a longer export into the same table without touching a single formula.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.

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 / shortcut | Syntax or keys | Use in month-end work |
|---|---|---|
| SUMIFS | SUMIFS(sum_range, criteria_range1, criteria1, …) | Debit and credit totals per account, per period or per cost centre |
| SUMIF | SUMIF(range, criteria, [sum_range]) | Older single-condition version, still common in inherited files |
| SUM | SUM(D24:D33) | Column totals of the TB |
| ROUND | ROUND(number, 2) | Removes floating-point noise before a zero test |
| IF | IF(test, value_if_true, value_if_false) | Turns a check into a readable status |
| COUNTIF | COUNTIF(range, criteria) | Finds accounts that exist in the GL but not on the TB list |
| F4 | F4 (Windows) / Cmd+T (Mac) | Cycles a reference through $A$2, A$2, $A2 and A2 |
| Fill down | Ctrl+D or double-click the fill handle | Copies the first SUMIFS down to all accounts |
| Paste as values | Ctrl+Alt+V, then V | Freezes a GL export before you start working on it |
| Show formulas | Ctrl+` (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.
- Mapping Accounts to Financial Statement Lines with XLOOKUP
- Bank Reconciliation with Matching Flags: COUNTIFS on Reference and Amount
- Accounts Receivable Ageing: Days Past Due, Buckets with IFS & a Chart
- Prepayments & Accruals: a Monthly Release Schedule
- Fixed Asset Register: SLN, Accumulated Depreciation, NBV & DB
- Budget vs Actual: Variance %, Favourable / Unfavourable & Materiality Flags
- Month-End Close: Checklist Deadlines with WORKDAY & the Intercompany Check
- Allowance for Doubtful Accounts: a Provision Matrix from the Ageing and the Month-End Entry
- Goods Received Not Invoiced: Accruing for Deliveries without a Supplier Invoice
- Payroll Cut-Off and Leave Liability: Accrued Wages and Unused Vacation Days
- Inventory at Month End: Count vs Book, Shrinkage and a Slow-Moving Provision
- Revenue Cut-Off: Shipments, Delivery Terms and Invoices around the Period End
- Deferred Revenue: Earning Service Plans by the Day with Overlapping Date Ranges
- Bank Loan Schedule: PMT, Interest vs Principal and the Current / Non-Current Split
- Foreign-Currency Revaluation at Month End: Open Items, Closing Rates and Unrealised FX
- Sales-Tax Control Account: Expected vs Charged Tax, Net Payable and the Reconciliation
- Balance Sheet Reconciliation Tracker: GL vs Support, Unexplained Differences and Status
- Cash Flow Statement, Indirect Method: from Net Profit to the Change in Cash (Waterfall Chart)
- Final Project: a Month-End Close Dashboard for Quillmark UK