# SUMIF formula generator

> Describe what you need and get a SUMIF formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested SUMIF examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/sumif · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

SUMIF adds up values for the rows that meet one condition: total travel expenses, revenue for one product, every invoice over $500.

Describe the task at [SUMIF formula generator](https://spreadsheetpractice.com/tools/formula-generator/sumif) and get a SUMIF formula for Excel and Google Sheets, tested on real data.

## Tested SUMIF examples

### Sum values greater than a number

`=SUMIF(B2:B9,">"&E1)`

Excel. Result on the sample sheet: $8,480. [See it and try it](https://spreadsheetpractice.com/formulas/sum-if-greater-than)

### Sum values based on criteria in Excel (SUMIF)

`=SUMIF(B2:B11,G1,D2:D11)`

Excel. Result on the sample sheet: $5,155. [See it and try it](https://spreadsheetpractice.com/formulas/sumif-sum-based-on-criteria)

### Sum values where the checkbox is checked

`=SUMIF(C2:C9,TRUE,B2:B9)`

Google Sheets. Result on the sample sheet: $804.75. [See it and try it](https://spreadsheetpractice.com/formulas/sum-where-the-checkbox-is-checked)

### Sum values if the date is before a certain date

`=SUMIF(B2:B8,"<"&F1,C2:C8)`

Excel. Result on the sample sheet: $5,190. [See it and try it](https://spreadsheetpractice.com/formulas/sum-if-date-is-before-a-date)

### Calculate percent of subtotal for each group

`=C2/SUMIF($A$2:$A$10,A2,$C$2:$C$10)`

Excel. Result on the sample sheet: 9 rows (D2:D10). [See it and try it](https://spreadsheetpractice.com/formulas/percent-of-group-subtotal)

### Fix #REF! after deleting a column

`=SUM(B2:E2)`

Excel. Result on the sample sheet: 4 rows (F2:F5). [See it and try it](https://spreadsheetpractice.com/formulas/ref-error-after-deleting-a-column)

### Calculate each category's share of the total

`=SUMIF($A$2:$A$11,E2,$B$2:$B$11)/SUM($B$2:$B$11)`

Excel. Result on the sample sheet: 3 rows (F2:F4). [See it and try it](https://spreadsheetpractice.com/formulas/percentage-of-total-by-category)

### Use IF with SUMIF to compare a total with a limit

`=IF(SUMIF($A$2:$A$8,D2,$B$2:$B$8)>E2,"Over limit","OK")`

Excel. Result on the sample sheet: 3 rows (F2:F4). [See it and try it](https://spreadsheetpractice.com/formulas/if-with-sumif-compare-total-to-limit)

## Questions

### What does the SUMIF formula generator do?

You describe the task in plain English, and it writes the formula, using SUMIF where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does SUMIF do?

SUMIF adds up values for the rows that meet one condition: total travel expenses, revenue for one product, every invoice over $500.

### Can I learn to write SUMIF formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the SUMIF function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
