AutoExel Logo

SUMIF: sum with conditions

Sum only values that meet a condition. Perfect for sales, budgets and filtered analyses.

SUMIF is the intelligent version of SUM. It allows you to sum only numbers that meet a specific condition, automatically filtering out the others.

How SUMIF works

Syntax:

=SUMIF(range, criteria, [sum_range])
  • range: where to check the condition
  • criteria: the condition to be met
  • sum_range: values to sum (optional, uses range if omitted)

Example 1: Sum sales over $1000

You have sales in column B and want to sum only those over $1000.

Formula:

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

Excel sums only cells in B2:B100 that contain values greater than 1000.

Example 2: Sum sales by salesperson

Column A has salesperson names, column B has amounts. You want the total for "John Smith".

Formula:

=SUMIF(A2:A100, "John Smith", B2:B100)

Search for "John Smith" in column A, and sum the corresponding values in column B.

Dynamic version (name in a cell):

=SUMIF(A2:A100, E2, B2:B100)

If the salesperson name is in E2, you can change it without modifying the formula

Example 3: Sum expenses by category

Column C has expense categories, column D has amounts. You want the total for "Marketing".

Formula:

=SUMIF(C2:C200, "Marketing", D2:D200)

Advanced criteria

Greater than (>):

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

Less than (<):

=SUMIF(B2:B100, "<200")

Not equal to (<>):

=SUMIF(A2:A100, "<>Cancelled", B2:B100)

Sum everything except rows with "Cancelled"

Contains text (with *):

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

Sum all rows starting with "New York"

Equal to a cell:

=SUMIF(A2:A100, E2, B2:B100)

The criteria is the value written in E2

Greater than a cell:

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

Sum values greater than the number in F2

SUMIFS: multiple conditions simultaneously

If you need to apply multiple conditions (e.g., sales > $1000 AND category "Premium"), use SUMIFS.

Syntax:

=SUMIFS(sum_range, criteria_range1, criteria1, criteria_range2, criteria2, ...)

Example: sales > $1000 by salesperson "John"

=SUMIFS(C2:C100, A2:A100, "John", C2:C100, ">1000")

Sum values in C that meet BOTH conditions

Common errors

Zero result (but there are values)

Problem: The criteria is written wrong or the ranges don't match

Solutions:

  • Check that numeric criteria are in quotes: ">100"
  • Check that range and sum_range have the same length
  • Check uppercase/lowercase and spaces in text criteria

Criteria with cell reference doesn't work

Problem: You write =SUMIF(A:A, > B1) instead of =SUMIF(A:A, ">"&B1)

Solution: Use quotes and concatenate: =SUMIF(A:A, ">"&B1)

Practical tips

1. Use absolute references for tables

=SUMIF($A$2:$A$100, E2, $B$2:$B$100)

The $ symbols lock the table when you copy the formula, but E2 adapts to E3, E4, etc.

2. Combine with other formulas

=SUMIF(A:A, YEAR(TODAY())&"-"&MONTH(TODAY()), B:B)

Sum only values from the current month

Tired of building complex criteria?

With AutoExel you describe what you want to filter and AI creates the correct SUMIF formula. No syntax to remember.

Try AutoExel Free

Frequently asked questions

Conditional sums without effort

AutoExel creates filters and sums automatically from your data. Forget formulas, focus on results.