Sub topic 6
Building monthly roll-ups from a ledger
This chapter assumes you can enter formulas, you understand relative and absolute references ($A5, C$3), and you have a flat ledger on a Data sheet with one transaction per row. It also assumes you know the basic SUMIFS shape: the sum range first, then pairs of criteria range and criterion.
The goal: one formula, filled across and down
A monthly roll-up is a grid. Accounts run down column A, months run across row 3, and every cell totals one account for one month. The aim is to write one formula in the top-left cell and fill it right and down without editing it.
The ledger layout used here is:
| Column | Contents |
|---|---|
| B | Account name |
| C | Category |
| D | Transaction date |
| F | Amount |
Headers sit in row 1 and data runs from row 2 to row 5000.
Month headers must be real dates
Row 3 holds the first day of each month, such as 2026-01-01, 2026-02-01, and so on. These must be true Excel dates, not text such as "Jan-26" typed as a label. SUMIFS compares numbers, so a text header never matches a date column.
A good pattern is to type the first month once, then build the rest with EDATE:
=EDATE(C3, 1)Place that in D3 and fill right. Format the row as mmm-yy so it displays as a short month name while the cell still holds a full date.
The monthly formula
Each cell needs three conditions: the right account, a date on or after the month start, and a date on or before the month end.
=SUMIFS(Data!$F$2:$F$5000, Data!$B$2:$B$5000, $A5, Data!$D$2:$D$5000, ">="&C$3, Data!$D$2:$D$5000, "<="&EOMONTH(C$3,0))Read it in pieces:
Data!$F$2:$F$5000is the sum range. It is fully anchored so it does not shift when you fill.Data!$B$2:$B$5000, $A5matches the account in the current row. The$beforeAkeeps the column fixed when you fill right. The row stays relative so it changes when you fill down.">="&C$3joins the operator and the date into one criterion. The$before3keeps the row fixed when you fill down. The column stays relative so it moves when you fill right."<="&EOMONTH(C$3,0)computes the last day of the month.EOMONTHwith an offset of 0 returns the end of the same month.
The same date range is used twice, once for each bound. All criteria ranges must be the same size as the sum range, or SUMIFS returns #VALUE!.
Why the dates use two conditions
A single condition such as ">="&C$3 would count every transaction from the month start onward, so January would include all later months. The upper bound closes the window. An alternative is to compare to the next month's start with "<"&C$4, but that breaks at the last column, because there is no next header. EOMONTH avoids that edge case.
Edge case: dates with a time component
If the ledger dates come from a system export, a value may carry a time, such as 2026-01-31 14:30. That number is larger than the date 2026-01-31, so "<="&EOMONTH(C$3,0) excludes it. The transaction silently falls out of every month.
Two fixes work:
- Strip the time in the data with
=INT(D2)in a helper column, and point the formula at that column. - Use a strict less-than against the first day of the next month:
"<"&EDATE(C$3,1). This captures every moment in the month, with or without a time.
=SUMIFS(Data!$F$2:$F$5000, Data!$B$2:$B$5000, $A5, Data!$D$2:$D$5000, ">="&C$3, Data!$D$2:$D$5000, "<"&EDATE(C$3,1))For ledgers with date-only values the EOMONTH form is fine. If you are unsure, the EDATE form is the safer default.
Rolling up by category with a wildcard
Sometimes you want a whole group, not one account. If categories are named Opex - Rent, Opex - Payroll, and so on, a wildcard captures all of them:
=SUMIFS(Data!$F$2:$F$5000, Data!$C$2:$C$5000, "Opex*")You can add the same two date conditions to this formula to get a monthly Opex total. Note that the * wildcard matches any number of characters, so "Opex*" also matches a category called Opex Reclass that you may not want. Check the distinct category names before relying on a prefix.
Totals and the reconciliation check
A roll-up is only trustworthy if it adds up to the source. Add a total row beneath the grid, here in row 10, and compare it with the ledger:
=ROUND(SUM(C10:N10) - SUM(Data!$F$2:$F$5000), 2)The result should be 0. A nonzero value means some ledger rows were missed. Common causes are:
- An account in the ledger that has no row in the roll-up, for example a new account or a misspelling.
- Dates outside the twelve months shown.
- Text in the date column, such as "2026/01/15" imported as text.
- Trailing spaces in an account name, so
"Rent "does not equal"Rent". - Data past row 5000, which the bounded range excludes.
ROUND(..., 2) removes floating-point noise, so a difference of 0.0000000001 does not show as an error.
Common errors at a glance
| Symptom | Likely cause | Fix |
|---|---|---|
| All cells return 0 | Month headers are text, or account names do not match | Convert headers to dates, trim names |
| `#VALUE!` | Criteria and sum ranges differ in size | Make every range the same rows |
| January includes later months | Missing upper date bound | Add the second date condition |
| Month-end transactions missing | Dates carry a time | Use `"<"&EDATE(C$3,1)` |
| Values shift when filled | Missing `$` on a range | Anchor the ranges |
| Check cell is not 0 | Unmapped account or out-of-range date | Investigate rows the grid missed |
Good habits for a ledger roll-up
- Keep the range bounds the same in every formula. If you extend to row 5000 in one place, do so everywhere. An Excel table with structured references removes this risk, because ranges grow with the data.
- Put the account list in column A from a clean source, and avoid typing names by hand.
- Add a check row per month as well as the overall one, so you can see which month is off.
- Never hard-code a date or account name inside the formula. Refer to a cell so the logic is visible and reusable.
Exercise
A roll-up cell for March uses the criteria ">="&E$3 and "<="&EOMONTH(E$3,0). A $2,000 transaction dated 2026-03-31 at 09:15 does not appear in any month, and the reconciliation check is off by 2,000. Why does this happen, and what formula change fixes it?
Show answer
The date 2026-03-31 09:15 is a larger number than the date 2026-03-31 at midnight, so it fails the "<=" test against EOMONTH, which returns midnight on the last day. It falls outside every month. Replace the upper bound with a strict less-than against the next month's start: "<"&EDATE(E$3,1). That includes every time on the last day.
Exercise
You fill the formula from C5 across to N5 and down to row 9. In row 6 the account filter returns zeros, though the account exists. The account reference is written as A$5 instead of $A5. What went wrong?
Show answer
With A$5 the row is locked, so every row filled downward still looks up the account in row 5. The column is relative, so filling right would also shift the reference to B, C, and so on. The reference must be $A5, which fixes the column and lets the row change.