Trial Balance Mapping in Excel: From GL Accounts to Financial Statements
The controller adds account 6185, “Software subscriptions, AI tools”, in March. The monthly reporting workbook maps accounts to P&L lines with a nested IF that tests account ranges, last edited two years ago. 6185 falls in a gap between two ranges and maps to nothing. Operating expenses are understated by 23,000, the P&L no longer ties to the trial balance, and the difference sits unexplained until the auditors arrive.
Every finance report built on a trial balance depends on mapping: each general ledger account assigned to a reporting line. This post builds that mapping in Excel 2021 or 365 with one table, a lookup that handles both individual accounts and ranges, a clear rule for debits and credits, and four checks that catch any account the mapping misses.
One mapping table
The mapping belongs in a table, not in formulas. One row per account (or per range of accounts), with every attribute reporting needs:
| Account | Name | Statement | Line | Subtotal | Sign |
|---|---|---|---|---|---|
| 4000 | Product revenue | P&L | Revenue | Gross profit | -1 |
| 4100 | Service revenue | P&L | Revenue | Gross profit | -1 |
| 5000 | Cost of goods sold | P&L | Cost of sales | Gross profit | 1 |
| 6100 | Salaries | P&L | Payroll | Operating expenses | 1 |
| 6185 | Software subscriptions | P&L | IT costs | Operating expenses | 1 |
| 1100 | Operating account | BS | Cash | Current assets | 1 |
Format it as a table named Map. When accounting adds an account, the mapping change is one new row. A report built on a mapping table can also be audited by reading it, which a nested IF cannot. One mapping table per dimension explains why the department and entity mappings get tables of their own.
Look up each account
On the trial balance, bring in the line with XLOOKUP and a default that cannot be missed:
=XLOOKUP([@Account], Map[Account], Map[Line], "UNMAPPED")
Do the same for statement, subtotal and sign. Every account that is not in the table shows UNMAPPED rather than an error or a blank, and the checks below count them.
Account ranges
Some charts of accounts are designed in ranges (all 6100 to 6199 are payroll). If the mapping is maintained by range, store the first account of each range and look up with match mode -1, which returns the nearest account at or below:
=XLOOKUP([@Account], MapRange[From], MapRange[Line], "UNMAPPED", -1)
The table must be sorted by From, and every gap in the chart needs its own row, or an account in the gap maps to the range below it. That is how 6185 can land in the wrong line rather than in UNMAPPED. A hybrid works well: ranges for the bulk, an exceptions table of individual accounts checked first:
=XLOOKUP([@Account], MapExceptions[Account], MapExceptions[Line],
XLOOKUP([@Account], MapRange[From], MapRange[Line], "UNMAPPED", -1))
Debits, credits and the sign column
A trial balance stores debits as positive and credits as negative, so it sums to zero. Revenue is a credit and arrives negative. Reports usually show revenue as positive. The sign column in the mapping table handles it:
=[@Balance] * XLOOKUP([@Account], Map[Account], Map[Sign])
Revenue accounts have sign -1, so they become positive; expense accounts have sign 1. Decide whether expenses show positive (subtracted in the report) or negative (added in the report), write it on the cover tab, and apply it through the sign column rather than in individual report formulas. Contra accounts, like sales returns inside revenue, keep the revenue line’s sign so they reduce revenue correctly.
Build the statements with SUMIFS
With the line on each trial balance row, every report line is one SUMIFS:
=SUMIFS(TB[Reporting amount], TB[Line], $A10, TB[Period], C$4)
Subtotals sum their lines, or use a SUMIFS on the Subtotal column. A new account mapped to an existing line appears in the report automatically.
Four checks
- Unmapped accounts.
=COUNTIFS(TB[Line], "UNMAPPED")must be zero. Put it at the top of the report, large. - The trial balance balances.
=SUM(TB[Balance])must be zero. If it is not, the extract is incomplete before mapping starts. - P&L ties. Net income from the mapped report equals the sum of all P&L account balances, times -1. A difference means an account is mapped to the wrong statement.
- Balance sheet balances. Total assets equal total liabilities and equity including current-year earnings. Tie the balance sheet first covers why this check comes before any analysis.
The four checks catch every mapping error that changes totals. They do not catch an account mapped to the wrong line within the same statement, which only review catches. Sort the mapping table by line once a quarter and read it.
Where it breaks
Mapping by account name. Names get edited; numbers do not. Map on the account number.
New accounts mid-year. The unmapped check catches them, but only if someone looks. Make a non-zero count block the report: show the check result in the report title.
Ranges with gaps. An account in an unassigned gap maps to the range below it. Add explicit rows for gaps, mapped to UNMAPPED, so new accounts there are caught.
Multiple entities with different charts. Map each entity’s accounts to a common group account first, then group accounts to lines. Two tables, each simple, instead of one table that tries to do both.
