Sub topic 2
Adding more conditions: criteria pairs and AND logic
Prerequisites
This chapter assumes you can enter formulas, read ranges such as A2:A100, and use COUNTIFS, SUMIFS, and AVERAGEIFS with one condition. The examples use a sales sheet with Date in column C, Region in column A, Units in column D, and Revenue in column E, with data in rows 2 to 100.
Criteria pairs and AND logic
Each condition is a criteria pair: a range, then a criterion for that range. Add pairs to narrow the rows. A row counts only when every pair is true, so the pairs combine with AND.
=SUMIFS(E2:E100, A2:A100, "West", D2:D100, ">=10")This adds Revenue for rows where Region is "West" and Units is at least 10.
Comparison operators in criteria
Place an operator inside the quoted criterion. The operators are >, <, >=, <=, <> (not equal), and = (equal). Without an operator, the criterion means equal.
Using cell values with &
Store the threshold in a cell, such as H1, and join it to the operator with &:
=SUMIFS(E2:E100, D2:D100, ">"&H1)Changing H1 updates the result without editing the formula.
Keeping ranges the same size
Every range in a pair must have the same number of rows. The sum range E2:E100 and the criteria range A2:A100 both have 99 rows, so they match. If one range is E2:E100 and another is A2:A50, Sheets returns an error instead of a result. When you see this error, check that each range starts and ends on the same rows.
Filtering by date range
Use two criteria on the same date column to define a start and an exclusive end:
=COUNTIFS(A2:A100, "West", C2:C100, ">="&DATE(2026,1,1), C2:C100, "<"&DATE(2026,2,1))This counts West rows dated in January 2026.
> The end date is exclusive, so February 1 is excluded.
Exercise
Write a COUNTIFS formula that counts West rows with a Date between March 1, 2026 and March 31, 2026, inclusive.
Show answer
=COUNTIFS(A2:A100, "West", C2:C100, ">="&DATE(2026,3,1), C2:C100, "<"&DATE(2026,4,1))