List the first account of each statement line, look up every account with an approximate match, and total by line. New accounts map themselves.
To map a trial balance in Excel, do not list every account in the mapping table. List the first account of each statement line, sorted, and find each account's line with an approximate match: =INDEX(lines,MATCH(account,starts,1)). An account opened next month falls into the right line without touching the map. Then =SUMIFS(balance,line,"Revenue") totals each line, and the lines must add up to zero like the trial balance itself.
The case comes from the Excel for Finance course by Julian R. Sterling, author of The Real Estate Asset Manager.Get the DRM-free PDF, $19.99 →
| From account | Statement line |
|---|---|
| 1000 | Cash |
| 1100 | Trade receivables, net |
| 1200 | Inventory |
| 1300 | Other current assets |
| 1500 | Property and equipment, net |
| 2000 | Payables and accruals |
| 2500 | Borrowings |
| 3000 | Equity |
| 4000 | Net revenue |
| 5000 | Cost of sales |
| 6000 | Operating expenses |
| 6500 | Depreciation |
| 6600 | Operating expenses |
| 7000 | Interest expense |
| 8000 | Income tax |
MATCH with 1 returns the position of the largest start that is less than or equal to the account. Account 1550, accumulated depreciation, lands on 1500, property and equipment, net. Account 6900 lands on 6600, operating expenses. The starts must be sorted in ascending order.
Line =INDEX($I$5:$I$19,MATCH([@Account],$H$5:$H$19,1))
Type =IF([@Account]<4000,"Balance sheet","Income statement")
Amount =SUMIFS(TB[Balance],TB[Line],K5)
With XLOOKUP (Excel 2021 and Microsoft 365) the line is =XLOOKUP([@Account],starts,lines,,-1): match mode -1 means exact or next smaller.
| Statement line | Amount |
|---|---|
| Cash | $255,800 |
| Trade receivables, net | $1,398,713 |
| Inventory | $541,800 |
| Other current assets | $33,000 |
| Property and equipment, net | $1,048,100 |
| Payables and accruals | -$892,400 |
| Borrowings | -$511,700 |
| Equity | -$1,704,194 |
| Net revenue | -$8,252,967 |
| Cost of sales | $6,507,549 |
| Operating expenses | $1,312,200 |
| Depreciation | $140,300 |
| Interest expense | $33,000 |
| Income tax | $90,800 |
| Total | $0 |
Revenue shows as -$8,252,967 because credits are negative. Net income is minus the sum of the income statement lines: $169,118.
Every figure is computed by script from the course's running case, Northgate Foods, a fictional food distributor, and checked on 27 November 2026. For education, not investment or accounting advice.
32 lessons on references, tables, INDEX and MATCH, XLOOKUP, SUMIFS, dates, text, pivot tables and checks, built on 5,000 invoice lines of one company, with step files, exercises, a quiz app and a certificate exam ($149).
Because the map then lists ranges, not accounts: any account between two starts takes the line of the lower one, including accounts opened after the map was built.
MATCH with 1 assumes ascending order. On an unsorted map it returns a plausible wrong line without any error, so keep the map sorted and check that the lines total zero.
Keeping debits positive and credits negative lets the lines add up to zero, which is the simplest check that nothing was lost.
This article is one calculation from The Real Estate Asset Manager. The book takes the same case from first principles to the decision, chapter by chapter, and every figure it prints is a live formula in the free companion workbooks.
See the course →Free companion files
Also on Amazon UK · Amazon Germany · Amazon France · Amazon Canada
Prefer a PDF? The same book is sold as a DRM-free PDF edition, searchable and printable. Get the PDF edition, $19.99