Sub topic 5
Criteria with operators, wildcards, and dates
Assume you know basic Excel formulas, relative and absolute references, and the layout of a simple financial model. This chapter uses a ledger with account names in column B, categories in column C, dates in column D, and amounts in column F.
Criteria strings control what SUMIFS includes
SUMIFS adds amounts only when every criteria pair is true. Its structure is:
=SUMIFS(sum_range, criteria_range1, criteria1, criteria_range2, criteria2)The criteria can be an exact value, a comparison, a wildcard pattern, or a date boundary.
| Criteria | Meaning |
|---|---|
| `"Opex"` | Exactly Opex |
| `">=100000"` | At least 100,000 |
| `"Opex*"` | Text beginning with Opex |
| `"<>Cancelled"` | Anything except Cancelled |
When the comparison value is in a cell, join the operator and cell reference with &:
=SUMIFS(Data!$F$2:$F$5000, Data!$F$2:$F$5000, ">="&$B$2)This totals amounts that are at least the threshold in B2. The quotation marks contain the operator, while & joins it to the cell's value.
Wildcards match text patterns
A wildcard represents unknown text:
*matches any number of characters, including no characters.?matches exactly one character.~makes the next wildcard literal.
For example, this formula includes Opex, Opex - Payroll, and Opex - Rent:
=SUMIFS(Data!$F$2:$F$5000, Data!$C$2:$C$5000, "Opex*")To match a literal question mark, use "~?". Wildcards are useful when categories have consistent prefixes, but they can hide inconsistent labels. Check the underlying data before relying on a broad pattern.
Date criteria define a period
Excel stores dates as numbers, so a date criterion can use >=, <, or <=. For a month, use the first day as an inclusive lower boundary and the first day of the next month as an exclusive upper boundary:
=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))Here, C3 contains the first day of the month. The formula includes dates from C3 onward, but excludes the first moment of the following month.
This boundary method also handles timestamps such as 31-Jan-2026 14:30. A criterion using <=EOMONTH(C3,0) can miss records later on the final day when the source contains times.
flowchart TD
A[Start date in C3] --> B[Date is >= C3]
B --> C[Date is < first day of next month]
C --> D[SUMIFS includes the row]
B --> E[Outside the lower boundary]
C --> F[Outside the upper boundary]Common errors
- Put each criteria range on the same rows as the sum range.
- Do not type an operator outside quotation marks unless it is joined to a cell.
- Confirm that source dates are real Excel dates, not text that only looks like a date.
- Use exact labels when possible. A wildcard can combine categories unintentionally.
- Keep range references anchored when copying formulas across a model.
Exercise
C3 contains 1-Apr-2026. Write a SUMIFS date condition that includes all April dates, including timestamps, but excludes May 1.
Show answer
Use two criteria on the date range: ">="&C3 and "<"&EDATE(C3,1).