Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed:
=SUMIF(B2:B5,"Red",C2:C5)Computed by a real spreadsheet engine on the sample data below.
| Item | Color Label | Amount |
| Apple | Red | 100 |
| Blueberry | Blue | 200 |
| Strawberry | Red | 150 |
| Grape | Blue | 180 |
=SUMIF(B2:B5,"Red",C2:C5)→250
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.
No. Neither application exposes cell fill color to worksheet formulas natively, even in Excel 365 / 2024. You must use a helper column, VBA macro, or Google Apps Script.
No — VBA is Excel-only. Sheets uses Apps Script (JavaScript-based). The equivalent: Extensions → Apps Script → write a custom function that uses range.getBackgrounds() to read the color hex, then sum matching cells.
Color changes don't trigger a recalculation. Either force a recalc (F9 in Excel, Ctrl+Shift+F9 in Sheets) after recoloring, or add a volatile reference like `+NOW()*0` to the formula so it re-evaluates on every workbook change (warning: degrades performance on large sheets).
Not directly. Macros read the underlying fill color, which conditional formatting doesn't change. Use the conditional rule's logic in SUMIF instead — e.g. if the rule highlights cells > 100, use =SUMIF(C2:C100,">100",C2:C100).
Same approach with a different VBA property: replace Interior.Color with Font.Color in the macro. The helper-column approach works identically — tag rows by category and SUMIF.
Apply Filter → Filter by Color to the value column, then look at the Sum in the status bar (Excel) or use =SUBTOTAL(9, range) which respects the filter. Fast for ad-hoc analysis; doesn't update when you change filters.
Multiply ranges together row by row and sum the result — ideal for weighted totals.
How-toAdd up an entire column with SUM. Total a whole column or a fixed range — identical in Excel and Google Sheets.
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-toBuild a cumulative running total with a SUM and a clever anchored reference that grows as you copy it down. Works in both apps.
How-toTotal amounts that fall in a given month with SUMIFS and two date bounds. Works the same in Excel and Google Sheets.
Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed: