Sub topic 3
Partial Matches with `*` and `?`
Assume you can enter and copy formulas, use relative and absolute references, and use SUM, COUNT, and AVERAGE. The examples use a data range from rows 2 through 100.
Partial matches with `*` and `?`
In criteria, * matches any number of characters, including no characters. ? matches exactly one character. Matching text is not case-sensitive.
=COUNTIFS(C2:C100,"Lap*")This counts products such as Laptop and Lap Stand. To match a product with exactly one unknown character, use:
=COUNTIFS(C2:C100,"?onitor")This can match Monitor, but not a word with a different number of characters.
Filtering by date and date ranges
Excel stores dates as numbers. Use comparison operators with DATE so the formula does not depend on regional date formatting.
=SUMIFS(D2:D100,A2:A100,">="&DATE(2025,1,1),A2:A100,"<"&DATE(2025,2,1))The first condition includes January 1. The second excludes February 1, so every time on January 31 is included.
Counting and filtering blanks
Use an empty string to match blank cells. Use <> to match cells that are not blank.
=COUNTIFS(B2:B100,"West",E2:E100,"")This counts West rows with no note.
Handling `#DIV/0!` in `AVERAGEIFS`
AVERAGEIFS returns #DIV/0! when no row meets the conditions. Wrap it in IFERROR when a readable result is better.
=IFERROR(AVERAGEIFS(D2:D100,B2:B100,"South"),"No sales")OR logic: several values for one field
Conditions inside one SUMIFS use AND logic. Add separate formulas for OR logic:
=SUMIFS(D2:D100,B2:B100,"West")+SUMIFS(D2:D100,B2:B100,"East")For several values, an array constant is shorter:
=SUM(SUMIFS(D2:D100,B2:B100,{"West","East"}))Copyable summary tables
For a region-by-product grid, use mixed references:
=SUMIFS($D$2:$D$100,$B$2:$B$100,$G2,$C$2:$C$100,H$1)$G2 keeps column G fixed while rows change. H$1 keeps row 1 fixed while columns change. An Excel table can grow automatically:
=SUMIFS(Sales[Amount],Sales[Region],"West")Troubleshooting and alternatives
#VALUE! often means the ranges have different sizes. #DIV/0! usually means no rows matched. Wrong totals commonly result from dates stored as text, misspelled criteria, or overlapping OR conditions that count a row twice.
Use a PivotTable when you need an interactive summary. Use SUMPRODUCT for unusual logic that IFS criteria cannot express easily. Use the IFS functions for clear, formula-based summaries.
Exercise
Write a formula that counts West rows whose product starts with "Mon" and whose note is blank.
Show answer
=COUNTIFS(B2:B100,"West",C2:C100,"Mon*",E2:E100,"")