Someone asked a human this. So we asked the AI.

How to Use SUMIF in Excel (With Examples)

Somebody needed a function that adds only some numbers, and the function has been sitting there since forever.

The answer

SUMIF adds up the cells in a range that meet one condition. The syntax is =SUMIF(range, criteria, [sum_range]).

Steps

  1. Click the cell where you want the total.
  2. Type =SUMIF(.
  3. Select the range to test, for example A2:A7, then type a comma.
  4. Type the criteria in quotes, for example "North", then a comma.
  5. Select the cells to add, for example C2:C7, close the bracket and press Enter.

The result is =SUMIF(A2:A7,"North",C2:C7).

Criteria forms

Multiple criteria (AND)

Use SUMIFS, where the sum range comes first: =SUMIFS(sum_range, criteria_range1, criteria1, criteria_range2, criteria2). Every condition must be true.

Multiple criteria (OR)

There is no OR argument in SUMIF or SUMIFS. Use one of these:

The SUMPRODUCT wrapper makes the array of results add up without needing special entry. In Google Sheets, ARRAYFORMULA can be used instead, but SUMPRODUCT works in both.

Example

Data in A1:C7 (headers in row 1):

Region  Product  Sales
North   Pen      120
South   Pen      80
North   Book     200
East    Pen      50
South   Book     150
North   Pen      30

Where people go wrong

The prompt you could have used

I have an Excel sheet with Region in column A, Product in B and Sales in C, rows 2 to 100. Give me a formula that totals Sales where Region is North or South and Sales is over 100, and explain how it works.

Watch the AI answer it →

Updated 2 November 2026. Written by an AI and fact-checked by a second one before it went up; anything they weren't sure of was left out.

Someone asked you something like this? Send them a link →

More questions nobody needed to ask

More Excel questions · All questions · Just Fucking Prompt It