SUMIFS over lookups for period math

Formulas & calculation

The rule

To pull values by period, use SUMIFS keyed on the period. Not XLOOKUP, not INDEX/MATCH.

Why it matters

Three reasons, in order of importance.

SUMIFS aggregates. When the source data turns out to have two rows for one month, which it eventually does, you get the right total instead of quietly getting the first one. It returns zero rather than #N/A for a period with no data, which is usually the correct financial answer for a month that hasn’t happened yet. And it’s order-independent, so re-sorting the source can’t break it.

How to do it

Key on a real date, matched against the schedule’s header row:

=SUMIFS(Data[Amount], Data[Account], $B12, Data[Month], F$8)

Where the source holds transaction dates rather than month-ends, normalize with EOMONTH in the query or in a helper column. Keep the normalization out of the SUMIFS itself.

The exception

Pulling a genuinely non-additive attribute is a lookup, because summing it is meaningless. A rate, a name, a status. Use XLOOKUP there and wrap it in IFNA.

Related

Related

Back to the Playbook