Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed:
=SUMIF(A2:A100,"Fruit",B2:B100)Computed by a real spreadsheet engine on the sample data below.
| Category | Sales |
| Fruit | 300 |
| Vegetable | 150 |
| Fruit | 200 |
| Dairy | 400 |
| Vegetable | 120 |
=SUMIF(A2:A100,"Fruit",B2:B100)→500
Edit the grid or formula, then run it through a real spreadsheet engine — no signup.
Sample data — click any cell to edit
Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.
Use SUMIFS, which accepts unlimited condition pairs and takes the sum range first: =SUMIFS(C2:C100,A2:A100,"Fruit",B2:B100,"Jan").
Spill the distinct labels with =UNIQUE(A2:A100), then next to it =SUMIF($A$2:$A$100,D2#,$B$2:$B$100) (Excel 365) or copy the SUMIF down (any version). New categories appear in the table automatically.
Yes: =SUMIF(A2:A100,"Fr*",B2:B100) sums every category beginning with "Fr"; "*berry" matches anything ending in berry; "?" stands for a single character.
No — "fruit" and "Fruit" match the same rows. For a case-sensitive sum use SUMPRODUCT with EXACT: =SUMPRODUCT(--EXACT(A2:A100,"Fruit"),B2:B100).
Use a PivotTable for ad-hoc exploration of many categories and dimensions; use SUMIF/SUMIFS when the summary must live inside a report layout and update instantly without a refresh.
Multiply ranges together row by row and sum the result — ideal for weighted totals.
How-toSum the 30 calendar days ending on a chosen date with SUMIFS, including timestamps on the final day and excluding future rows.
Error fixSUM returns 0 or the wrong total in Excel and Google Sheets — fix numbers stored as text, filtered ranges, manual calculation mode, and circular references.
ReferenceAggregate a range (sum, average, count…) while ignoring other SUBTOTALs and, optionally, hidden rows. Ideal under filters.
How-toAdd up an entire column with SUM. Total a whole column or a fixed range — identical in Excel and Google Sheets.
How-toBuild a cumulative running total with a SUM and a clever anchored reference that grows as you copy it down. Works in both apps.
Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed: