---
title: "SUMIF function in Excel: syntax and examples | ExcelSavvy"
description: "How to use SUMIF in Excel and Google Sheets: add only the rows that meet a condition. Syntax, examples and a live drill."
canonical_url: "https://excelsavvy.com/functions/sumif"
meta:
  "og:description": "How to use SUMIF in Excel and Google Sheets: add only the rows that meet a condition. Syntax, examples and a live drill."
  "og:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~U1VNSUYgZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBTVU1JRiBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogYWRkIG9ubHkgdGhlIHJvd3MgdGhhdCBtZWV0IGEgY29uZGl0aW9uLiBTeW50YXgsIGV4YW1wbGVzIGFuZCBhIGxpdmUgZHJpbGwu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~U1VNSUYocmFuZ2UsIGNyaXRlcmlhLCBbc3VtX3JhbmdlXSk%2Cp_Ii9mdW5jdGlvbnMvc3VtaWYi%2Cs_O0S-yUpMULYKTHFJ.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "SUMIF function in Excel: syntax and examples | ExcelSavvy"
  "twitter:image": "https://excelsavvy.com/_og/d/c_Page%2Ctitle_~U1VNSUYgZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBTVU1JRiBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogYWRkIG9ubHkgdGhlIHJvd3MgdGhhdCBtZWV0IGEgY29uZGl0aW9uLiBTeW50YXgsIGV4YW1wbGVzIGFuZCBhIGxpdmUgZHJpbGwu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~U1VNSUYocmFuZ2UsIGNyaXRlcmlhLCBbc3VtX3JhbmdlXSk%2Cp_Ii9mdW5jdGlvbnMvc3VtaWYi%2Cs_O0S-yUpMULYKTHFJ.png"
---

> Index of every page on this site: [llms.txt](https://excelsavvy.com/llms.txt)

# **The SUMIF function**

Adds the cells that meet one condition. The condition can be checked in the same range or in another column.

=

SUMIF(

## **How to use SUMIF**

SUMIF is a total with a filter. Picture a pile of receipts where you only want to add the ones from one shop. SUMIF looks at each row, checks the condition, and counts the amount only when the condition is met.

You give it three things: the range to check (the shop names), the condition (`**"North"**`), and the range that holds the amounts to add. In `**=SUMIF(A2:A10,"North",C2:C10)**` the two ranges line up row by row. If you leave out the last argument, SUMIF adds the cells it checked, as in `**=SUMIF(C2:C10,">300")**`.

The condition can be text, a number, or a comparison inside quotes such as `**">300"**` or `**"<>North"**`. Wildcards let you match part of a text: `**"*shoe*"**` matches every cell with shoe somewhere in it. To compare with a value in a cell, join the two with `**&**`, like `**">"&E1**`.

SUMIF holds one condition only. When region and product must both match, use SUMIFS, which puts the sum range first. To count the matching rows instead of adding them, use COUNTIF.

## **Syntax**

```
SUMIF(range, criteria, [sum_range])
```

<dl><dt>**range **</dt>
<dd>The cells the condition is checked against.</dd>
<dt>**criteria **</dt>
<dd>The condition, such as "North", "&gt;300" or a cell like E1.</dd>
<dt>**sum_range **(optional)</dt>
<dd>The cells to add. If left out, range itself is added.</dd></dl>

## **Examples**

E1`=SUMIF(<sup>1</sup>A2:A6,<sup>2</sup>"North",<sup>3</sup>C2:C6)`

|  | A | B | C | D | E |
| --- | --- | --- | --- | --- | --- |
| 1 | Region | Product | Sales |  | **1170** |
| 2 | North | Shoes | 500 |  | |
| 3 | South | Shoes | 300 |  | |
| 4 | North | Bags | 250 |  | |
| 5 | North | Shoes | 420 |  | |
| 6 | South | Bags | 180 |  | |

**In plain words:** Add up <sup>3</sup>the sales in C2:C6 on the rows where <sup>1</sup>the region in A2:A6 is <sup>2</sup>North.

E1=SUMIF(C2:C6,">300")

|  | A | B | C | D | E |
| --- | --- | --- | --- | --- | --- |
| 1 | Region | Product | Sales |  | **920** |
| 2 | North | Shoes | 500 |  | |
| 3 | South | Shoes | 300 |  | |
| 4 | North | Bags | 250 |  | |
| 5 | North | Shoes | 420 |  | |
| 6 | South | Bags | 180 |  | |

## **Common SUMIF mistakes**

- SUMIF returns 0 although matching rows exist

  Usually the cells do not match exactly. Numbers stored as text in the sum range are skipped, and a category like `**North **` with a space at the end is not the same as `**North**`. Turn the text into real numbers, clean the names with TRIM, or use a wildcard such as `**"North*"**`.
- A condition like ">E1" adds nothing

  Inside quotes, E1 is just the two letters E1. Join the operator and the cell with &: `**=SUMIF(C2:C6,">"&E1)**`.
- SUMIF rejects a condition such as >300 written without quotes

  A condition with an operator is text, so it needs quotes: `**=SUMIF(C2:C6,">300")**`.
- SUMIF adds the wrong rows

  SUMIF lines the sum range up with the range from its first cell. In `**=SUMIF(A2:A6,"North",C3:C7)**` A2 is paired with C3, so every amount is read one row too low. Start both ranges in the same row.

## **Practice SUMIF**

- [**1****SUMIF with a text criterion**→](https://excelsavvy.com/practice/sumif/sumif-text-criteria)
- [**2****SUMIF with a number condition**→](https://excelsavvy.com/practice/sumif/sumif-greater-than)
- [**3****SUMIF with a separate sum\_range**→](https://excelsavvy.com/practice/sumif/sumif-with-sum-range)
- [**4****SUMIF with the criterion in a cell**→](https://excelsavvy.com/practice/sumif/sumif-criteria-from-a-cell)
- [**5****SUMIF with a wildcard**→](https://excelsavvy.com/practice/sumif/sumif-wildcard-contains)

## **Read the guide**

- [**Excel test for a job interview: what it looks like and how to practice**](https://excelsavvy.com/learn/excel-for-job-interviews)
- [**Free Excel course online: learn Excel from your first formula to job-ready**](https://excelsavvy.com/learn/how-to-learn-excel)
- [**Pivot tables explained, and the formulas that do the same job**](https://excelsavvy.com/learn/pivot-tables)
- [**Excel for finance and accounting: the skills you actually use**](https://excelsavvy.com/learn/excel-for-finance)
- [**How to make a graph in Excel: column, line and pie charts step by step**](https://excelsavvy.com/learn/excel-charts)
- [**Excel budget template: free download and the formulas behind it**](https://excelsavvy.com/learn/excel-budget-template)
- [**Excel practice data: free datasets with tasks and answers**](https://excelsavvy.com/learn/excel-practice-data)
- [**Pivot table practice: 15 exercises with answers on real sales data**](https://excelsavvy.com/learn/pivot-table-practice)
- [**Excel inventory data: free practice file with tasks and answers**](https://excelsavvy.com/learn/excel-inventory-data)
- [**Excel customer data: free practice file with tasks and answers**](https://excelsavvy.com/learn/excel-customer-data)
- [**Excel finance data: free practice file with tasks and answers**](https://excelsavvy.com/learn/excel-finance-practice-data)

## **Questions**

<details>

<summary>

### How do I use SUMIF with a cell as the condition?

</summary>

Point the criteria at the cell, like =SUMIF(A2:A6,E1,C2:C6). For a comparison, join the operator with &amp;: "&gt;"&amp;E1.

</details>

<details>

<summary>

### How do I sum cells that contain certain text?

</summary>

Wrap the text in asterisks: =SUMIF(B2:B6,"\*shoe\*",C2:C6) adds the sales on every row where the product contains shoe. A question mark stands for exactly one character. Text matching ignores upper and lower case.

</details>

<details>

<summary>

### How do I sum everything except one value?

</summary>

Put &lt;&gt; in front of the value: =SUMIF(A2:A6,"&lt;&gt;North",C2:C6). If the value is in a cell, write "&lt;&gt;"&amp;E1.

</details>

<details>

<summary>

### Can SUMIF use more than one condition?

</summary>

No, SUMIF has room for one. Use SUMIFS when every condition must be true, or add two SUMIF formulas when either condition may be true: =SUMIF(A2:A6,"North",C2:C6)+SUMIF(A2:A6,"South",C2:C6).

</details>

## **Related functions**

- [**SUMIFS**](https://excelsavvy.com/functions/sumifs)
- [**COUNTIF**](https://excelsavvy.com/functions/countif)
- [**AVERAGEIF**](https://excelsavvy.com/functions/averageif)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://excelsavvy.com/#identity","@type":"Organization","name":"ExcelSavvy","url":"https://excelsavvy.com/","logo":{"@id":"https://excelsavvy.com/#logo"}},{"@id":"https://excelsavvy.com/#website","@type":"WebSite","inLanguage":"en-US","name":"ExcelSavvy","url":"https://excelsavvy.com/","alternateName":["Excel Savvy","ExcelSavvy.com","PracticeExcel","Practice Excel Online"],"publisher":{"@id":"https://excelsavvy.com/#identity"},"workTranslation":[{"@id":"https://excelopgaver.dk/#website"},{"@id":"https://excelpraxis.de/#website"}]},{"@id":"https://excelsavvy.com/functions/sumif#webpage","dateModified":"2026-11-16","description":"How to use SUMIF in Excel and Google Sheets: add only the rows that meet a condition. Syntax, examples and a live drill.","name":"SUMIF function in Excel: syntax and examples","url":"https://excelsavvy.com/functions/sumif","@type":["WebPage","FAQPage"],"breadcrumb":{"@id":"https://excelsavvy.com/functions/sumif#breadcrumb"},"isPartOf":{"@id":"https://excelsavvy.com/#website"},"mainEntity":[{"@id":"https://excelsavvy.com/functions/sumif#/schema/question/1"},{"@id":"https://excelsavvy.com/functions/sumif#/schema/question/2"},{"@id":"https://excelsavvy.com/functions/sumif#/schema/question/3"},{"@id":"https://excelsavvy.com/functions/sumif#/schema/question/4"}],"potentialAction":[{"@type":"ReadAction","target":["https://excelsavvy.com/functions/sumif"]}],"primaryImageOfPage":{"@id":"https://excelsavvy.com/#logo"}},{"@id":"https://excelsavvy.com/functions/sumif#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://excelsavvy.com","position":1},{"@type":"ListItem","name":"Excel functions","item":"https://excelsavvy.com/functions","position":2},{"@type":"ListItem","name":"SUMIF function in Excel: syntax and examples","position":3}]},{"@id":"https://excelsavvy.com/functions/sumif#article","dateModified":"2026-11-16","description":"How to use SUMIF in Excel and Google Sheets: add only the rows that meet a condition. Syntax, examples and a live drill.","headline":"SUMIF function in Excel: syntax and examples","inLanguage":"en-US","thumbnailUrl":"https://excelsavvy.com/_og/d/c_Page%2Ctitle_~U1VNSUYgZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBTVU1JRiBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogYWRkIG9ubHkgdGhlIHJvd3MgdGhhdCBtZWV0IGEgY29uZGl0aW9uLiBTeW50YXgsIGV4YW1wbGVzIGFuZCBhIGxpdmUgZHJpbGwu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~U1VNSUYocmFuZ2UsIGNyaXRlcmlhLCBbc3VtX3JhbmdlXSk%2Cp_Ii9mdW5jdGlvbnMvc3VtaWYi%2Cs_O0S-yUpMULYKTHFJ.png","@type":["Article","TechArticle"],"author":{"@id":"https://excelsavvy.com/#identity"},"image":{"@id":"https://excelsavvy.com/#/schema/image/1"},"isPartOf":{"@id":"https://excelsavvy.com/functions/sumif#webpage"},"mainEntityOfPage":{"@id":"https://excelsavvy.com/functions/sumif#webpage"},"publisher":{"@id":"https://excelsavvy.com/#identity"}},{"@id":"https://excelsavvy.com/functions/sumif#/schema/question/1","@type":"Question","inLanguage":"en-US","name":"How do I use SUMIF with a cell as the condition?","acceptedAnswer":{"@type":"Answer","text":"Point the criteria at the cell, like =SUMIF(A2:A6,E1,C2:C6). For a comparison, join the operator with &: \">\"&E1."}},{"@id":"https://excelsavvy.com/functions/sumif#/schema/question/2","@type":"Question","inLanguage":"en-US","name":"How do I sum cells that contain certain text?","acceptedAnswer":{"@type":"Answer","text":"Wrap the text in asterisks: =SUMIF(B2:B6,\"*shoe*\",C2:C6) adds the sales on every row where the product contains shoe. A question mark stands for exactly one character. Text matching ignores upper and lower case."}},{"@id":"https://excelsavvy.com/functions/sumif#/schema/question/3","@type":"Question","inLanguage":"en-US","name":"How do I sum everything except one value?","acceptedAnswer":{"@type":"Answer","text":"Put \u003C> in front of the value: =SUMIF(A2:A6,\"\u003C>North\",C2:C6). If the value is in a cell, write \"\u003C>\"&E1."}},{"@id":"https://excelsavvy.com/functions/sumif#/schema/question/4","@type":"Question","inLanguage":"en-US","name":"Can SUMIF use more than one condition?","acceptedAnswer":{"@type":"Answer","text":"No, SUMIF has room for one. Use SUMIFS when every condition must be true, or add two SUMIF formulas when either condition may be true: =SUMIF(A2:A6,\"North\",C2:C6)+SUMIF(A2:A6,\"South\",C2:C6)."}},{"@id":"https://excelsavvy.com/#logo","@type":"ImageObject","caption":"ExcelSavvy","contentUrl":"https://excelsavvy.com/brand/practiceexcel/icon-512.png?v=3","inLanguage":"en-US","url":"https://excelsavvy.com/brand/practiceexcel/icon-512.png?v=3"},{"@id":"https://excelsavvy.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://excelsavvy.com/_og/d/c_Page%2Ctitle_~U1VNSUYgZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBTVU1JRiBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogYWRkIG9ubHkgdGhlIHJvd3MgdGhhdCBtZWV0IGEgY29uZGl0aW9uLiBTeW50YXgsIGV4YW1wbGVzIGFuZCBhIGxpdmUgZHJpbGwu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~U1VNSUYocmFuZ2UsIGNyaXRlcmlhLCBbc3VtX3JhbmdlXSk%2Cp_Ii9mdW5jdGlvbnMvc3VtaWYi%2Cs_O0S-yUpMULYKTHFJ.png","inLanguage":"en-US","url":"https://excelsavvy.com/_og/d/c_Page%2Ctitle_~U1VNSUYgZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBTVU1JRiBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogYWRkIG9ubHkgdGhlIHJvd3MgdGhhdCBtZWV0IGEgY29uZGl0aW9uLiBTeW50YXgsIGV4YW1wbGVzIGFuZCBhIGxpdmUgZHJpbGwu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~U1VNSUYocmFuZ2UsIGNyaXRlcmlhLCBbc3VtX3JhbmdlXSk%2Cp_Ii9mdW5jdGlvbnMvc3VtaWYi%2Cs_O0S-yUpMULYKTHFJ.png"}]}
```

## Sitemap

See the full [sitemap](https://excelsavvy.com/sitemap.md) for all pages.
