Knowledge base / Excel
SUMIFS in Excel: multiple criteria and date boundaries
A shared PL/EN table explains simultaneous criteria, cell parameters and October's final hours. I also show why equal range lengths do not guarantee alignment.

SUMIFS adds numbers from records satisfying every supplied criterion. I start by describing the conditions in a sentence: product Atlas, region North and a timestamp in October. Then I select the sum range and the corresponding criteria ranges.
A small synthetic table will illustrate simultaneous matching, month boundaries and range alignment. A quantity total remains different from a count of records. Establish which answer you need before writing the formula.
Syntax and argument order
Microsoft documents SUMIFS, called SUMA.WARUNKÓW in Polish, for Microsoft 365 and Excel 2016, 2019, 2021 and 2024, among other editions.
=SUMIFS(sum_range,criteria_range1,criteria1,[criteria_range2,criteria2],...)
First supply the numbers to add, followed by pairs consisting of a range to evaluate and its criterion. Further pairs are optional. Square brackets belong to the syntax description, rather than an actual formula. One criterion is allowed even though the function supports several.
SUMIF places its optional sum range last. SUMIFS puts a required sum range first. Do not convert a formula simply by changing the function name. I use commas here; regional configuration determines the separator in your environment.
One table with explicit content types
Place headers in A1:D1 and four records in rows 2-5. The labels Atlas, North and South are identical in both language versions. Column C must contain actual Excel date-time values, rather than text that looks like dates. The table shows a display format, not a universal import format.
| Row | A: Product | B: Region | C: Timestamp | D: Units |
|---|---|---|---|---|
| 2 | Atlas | North | 2026-10-01 09:00 | 10 |
| 3 | Atlas | South | 2026-10-15 12:00 | 20 |
| 4 | Atlas | North | 2026-10-31 18:00 | 5 |
| 5 | Atlas | North | 2026-11-01 00:00 | 15 |
First ask for all Atlas units in North, without a date condition:
=SUMIFS(D2:D5,A2:A5,"Atlas",B2:B5,"North")
Rows 2, 4 and 5 contribute. Their quantities 10, 5 and 15 produce 30. The South row is excluded. Criteria apply to the same position in their ranges: the product and region must match in the same record.
Several criteria mean simultaneous conditions
Adding another criteria pair narrows the matching records. It does not mean Atlas or North. Every product in our table is Atlas, so that criterion removes nothing yet. Keeping it in the formula makes the intended rule explicit when another product is added later.
For alternative categories, first establish whether the matching sets overlap. Adding separate totals for North and quantities greater than 10 would count some records twice. Addition does not remove their shared part. North and South are distinct labels in this simple region column, but a different alternative requires its own assessment on the actual records.
Include the last day’s hours
Now sum Atlas units in North from the beginning of October up to, but excluding, the beginning of November:
=SUMIFS(D2:D5,A2:A5,"Atlas",B2:B5,"North",C2:C5,">="&DATE(2026,10,1),C2:C5,"<"&DATE(2026,11,1))
DATE constructs a date from year, month and day. The & operator joins each comparison operator to that value. Rows 2 and 4 contribute 10 and 5, producing 15. Row 3 fails the region condition, while row 5 lies exactly on the excluded upper boundary.
Why avoid ending with "<="&DATE(2026,10,31)? That date refers to the beginning of October 31. The timestamp at 18:00 on the same day is later. Using less than the first day of the following month includes the entire final day without inventing a final possible time.
Microsoft describes dates as serial numbers and time as fractions of a day. This supports the comparison. If column C contains imported text, establish its type and conversion first. A similar-looking display does not prove that the cell holds a valid date-time value.

Put criteria in separate cells
Enter Atlas in F2, North in G2, an actual date for October 1 in H2 and November 1 in I2. Then write:
=SUMIFS(D2:D5,A2:A5,F2,B2:B5,G2,C2:C5,">="&H2,C2:C5,"<"&I2)
The result remains 15. Label H2 as the inclusive start and I2 as the exclusive end. Otherwise, someone entering October 31 in I2 may expect the formula to include that entire day. Parameters are helpful when their meaning is clear to the person changing them.
Dimensions and alignment
Microsoft requires the same number of rows and columns in the ranges. D2:D5 matches the dimensions of A2:A5, B2:B5 and C2:C5. D2:D4 has a different length. The SUMIFS error documentation explains that inconsistent dimensions produce a value error.
Equal dimensions are necessary without establishing the correct selection. Shifting one range by a row can preserve its length while comparing criteria with the wrong records. Check the starting and ending rows as well. The function matches positions; it does not join records using an identifier.
Interpret zero carefully
Zero can mean no matches or matching numbers whose sum is zero. It does not automatically indicate a formula error. If you need the number of matching records, use COUNTIFS. For one criterion, SUMIF is another option.
Do not assume hiding a row visually adds a condition to the formula. Its arguments describe the selection here. Visibility after filtering is a separate question, discussed in the entry on SUM and SUBTOTAL.
Practise the period boundary
Change the region to South. The October result becomes 20. Return to North and change the upper boundary to December 1. The November quantity of 15 now contributes, producing 30. Identify the expected rows by inspection before each change.
Finally, explain why October 31 at 18:00 belongs in the October total while November 1 at midnight does not. Connecting that explanation to the formula’s arguments and the cell’s content type demonstrates more understanding than remembering where the parentheses go.
Key takeaways
Do SUMIFS criteria work as OR conditions?
No. Every supplied criterion must match at the corresponding range position. Adding separate totals for alternatives requires checking whether any records contribute twice.
How do I include a whole month when records contain times?
Use an inclusive start at the beginning of the month and an exclusive end at the beginning of the next. An inclusive date for the last day can exclude its hours after midnight.
Do equally long ranges guarantee a correct result?
No. Their dimensions must agree, but they must also correspond to the same records. Shifting one range by a row can preserve its length while breaking the intended matching.
AI was used in an automated way while working on this article. If you want to learn how to do it too, check out this project.
