How to Use SUMIF in Excel

Add up only the cells that match a label, a comparison, or a wildcard pattern with SUMIF, then combine several conditions with SUMIFS.

You have a list of transactions and want the total for one category, or for amounts above a threshold. SUMIF adds up only the rows that match.

Type the formula

=SUMIF(A2:A100, "Rent", B2:B100)
  • range is the cells to test, here the category column.
  • criteria is what to match, in quotes when it is text.
  • sum_range is the cells to add up, here the amount column.

If three rows are labeled Rent with amounts 1200, 1200, and 1250, the cell shows 3650. Matching is not case sensitive, so rent and RENT count too.

Sum by comparison

Put the operator inside the quotes:

=SUMIF(B2:B100, ">100")

When sum_range is left out, Excel adds the cells in range itself. The operators >, <, >=, <=, and <> all work. To compare against a cell instead of a typed number, join them with &:

=SUMIF(B2:B100, ">"&D1)

Match part of the text with wildcards

=SUMIF(A2:A100, "Rent*", B2:B100)

* stands for any run of characters and ? for exactly one, so "Rent*" matches Rent, Rental, and Rent deposit. To match a literal asterisk or question mark, put a tilde in front: "~*".

Add more conditions with SUMIFS

SUMIFS takes the sum range first, then pairs of range and criteria. Every pair must be true for a row to count:

=SUMIFS(C2:C100, A2:A100, "Rent", B2:B100, ">=1/1/2026")

This adds column C where column A says Rent and the date in column B is on or after January 1, 2026. Add another pair for each extra condition, up to 127.

If the ranges are different sizes. Make sum_range and each criteria range the same height. Excel lines them up row by row from the first cell, and a shorter or offset range gives a wrong total without any error.

If the date criterion is not matching. Text dates like ">=1/1/2026" depend on the regional date format. Build the date with DATE instead: ">="&DATE(2026,1,1). The same trick works for a date held in a cell: ">="&E1.

More Excel how-tos