The basic Google Sheets SUM formula is =SUM(A1:A10), which adds all numbers in cells A1 through A10. For example, if those cells contain 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10, the formula returns 55.
What the SUM Function Does
SUM is a built-in function that adds together a set of numbers. It accepts up to 255 individual arguments in Google Sheets. Each argument can be a number, a cell reference, a range like A1:A10, or even a mixed list. The function ignores empty cells, text, and logical values (TRUE/FALSE) that are inside a referenced range. If you reference a cell containing text, that text is skipped, not treated as zero.
For instance, =SUM(5, 10, 15) returns 30. You can also combine references and numbers: =SUM(A1, 100) adds the value in A1 plus 100. The function is case-insensitive and works the same across Google Sheets on the web, Android, and iOS.
How to Write a SUM Formula
You can type the formula directly into a cell, or use the built-in menu. To type it manually:
- Click the cell where you want the total.
- Type
=SUM(. - Select the range with your mouse, or type it manually (e.g.,
B2:B20). - Close the parenthesis and press Enter.
Alternatively, use the menu: click the cell, go to Insert > Function > SUM, then select the range. On the toolbar, you can also click the sigma (Σ) icon and choose SUM; Sheets will guess the range, which you can adjust.
If you have multiple ranges, separate them with commas: =SUM(A1:A10, C1:C10). This adds the first range and the second range together.
Choosing Between SUM and Other Methods
For simple totals, SUM is the best choice. But sometimes you need something else:
- SUMIF: Adds numbers that meet a condition, like
=SUMIF(A1:A10, ">5")to sum only values greater than 5. - SUMIFS: Adds numbers that meet multiple conditions, e.g.,
=SUMIFS(B1:B10, A1:A10, "North")sums B where A is “North”. - SUBTOTAL: Adds numbers but ignores hidden rows, useful for filtered data:
=SUBTOTAL(109, B2:B20). - ARRAYFORMULA: For more complex array operations, but not needed for basic sums.
If you only need to see a total quickly without a permanent formula, select the range and look at the status bar at the bottom right; it shows the sum of selected cells by default.
Common Problems and Fixes
Several issues can trip up SUM formulas:
- #VALUE! error: Usually happens when you use text that can’t be coerced to a number, like
=SUM("abc"). Fix: use numbers or references. - Text numbers not adding: If cells contain numbers stored as text (often with a green triangle), SUM may ignore them. Fix: select the column, go to Data > Split text to columns (if needed) or use
=VALUE()to convert, or multiply by 1:=ARRAYFORMULA(SUM(VALUE(A1:A10))). - Wrong range: Double-check the range; a missing row can cause an incorrect total.
- Hidden rows: SUM includes hidden rows. If you don’t want that, use SUBTOTAL(109).
- Circular reference: If the formula is in a cell that’s part of the range, you get a circular reference warning. Move the total to another column.
Also, note that SUM does not ignore errors in referenced cells. If any cell in the range has an error like #DIV/0!, the SUM returns that error. Use =IFERROR(SUM(...), 0) to avoid.
SUM Across Sheets and Files
You can sum across different sheets in the same spreadsheet. For example, =SUM(Sheet1!A1:A10, Sheet2!A1:A10) adds the ranges from both sheets. If the sheet name has spaces, use single quotes: =SUM('My Sheet'!A1:A10).
To sum an entire column or row, use =SUM(A:A) or =SUM(1:1). Be careful: this includes all cells in that column, which can be slow if the sheet is huge, but it’s acceptable for most uses.
For data in a different spreadsheet file, you can use IMPORTRANGE: =SUM(IMPORTRANGE("spreadsheet_url", "Sheet1!A1:A10")). You’ll need to allow access the first time.
SUM with Conditions (SUMIF and SUMIFS)
When you need to add numbers based on a condition, use SUMIF. For example, with sales in B2:B20 and region in A2:A20, to sum sales for “East”: =SUMIF(A2:A20, "East", B2:B20). The criteria can be a number, text, or expression like “>100”.
For multiple conditions, use SUMIFS. The syntax is =SUMIFS(sum_range, criteria_range1, criterion1, [criteria_range2, criterion2, ...]). For instance, to sum sales where region is “East” and product is “Widget”: =SUMIFS(B2:B20, A2:A20, "East", C2:C20, "Widget"). Note that SUMIFS puts the sum range first, unlike SUMIF.
These functions are case-insensitive by default. To make them case-sensitive, you’d need a workaround with ARRAYFORMULA and EXACT, but that’s advanced.
Frequently Asked Questions
How do I sum only visible cells after filtering?
Use SUBTOTAL with function number 109: =SUBTOTAL(109, A1:A10). This ignores rows hidden by a filter or manually. For a quick total, select the filtered range and check the status bar, which already excludes hidden rows.
Why is my SUM returning 0?
Usually because the cells contain text, not numbers. Check if the cells are left-aligned (text) vs right-aligned (numbers). Convert text to numbers by selecting the column, going to Data > Split text to columns (if they have spaces), or use =VALUE() in a helper column. Also, ensure the range is correct.
Can I sum a column with blank cells?
Yes, SUM ignores blanks. For example, =SUM(A:A) will add all numbers in column A, skipping empty cells and text. It works fine.
How do I sum every other row?
Use SUMPRODUCT with MOD: =SUMPRODUCT((MOD(ROW(A1:A10),2)=1)*A1:A10) sums odd rows. For even rows, change =1 to =0. This is an array formula but SUMPRODUCT handles it without special entry.
What’s the difference between SUM and plus (+) in Google Sheets?=A1+A2 adds only those two cells. If either cell contains text, it returns #VALUE!. SUM is more forgiving: =SUM(A1:A2) ignores text within the range. For a single pair, both work, but SUM is safer for ranges.
Does SUM work with time values?
Yes, SUM adds time values, but the result may display as a time or a decimal depending on formatting. To get total hours over 24, format the result cell as Duration (Format > Number > Duration). For example, summing 08:00 and 09:00 gives 17:00.
Keyboard Shortcuts and Tips
To quickly insert a SUM formula, select the cell below a column of numbers and press Alt + = on Windows or Ctrl + Shift + = on Mac. Google Sheets automatically inserts =SUM() and selects the range above. Press Enter to accept.
You can also use the Explore feature (bottom right) to get quick sums, but it’s not as precise. For large datasets, avoid using entire column references like A:A if you have over 100,000 rows; it can slow down calculations. Instead, use a specific range like A2:A1000.
Remember that SUM is a volatile function only when combined with other volatile functions like NOW, but by itself it recalculates when the data changes. There’s no need to worry about manual calculation unless you’ve turned it off in File > Settings.
Related
- How to Make a Dictionary in Java
- Balanced Budgeting Fundamentals Notes
- VB Date Format Now: Syntax, Examples & Tips
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Google Sheets Jira Add-On: Setup, Features, and LimitsYes—Atlassian’s Jira Cloud for Sheets add-on connects Jira Cloud with Google Sheets so you can bring Jira issues…
- Excel Header Drop-Downs: Add Filters or Choice ListsTo add a drop-down arrow for sorting or filtering, turn your data into an Excel table: select the…
- Debt Payoff Tracker Excel Template: How to Build OneYes. A debt payoff tracker Excel template can be a simple workbook with one sheet for each debt’s…
- Fuel Template Excel for Fuel Budget PlanningA fuel budget template in Excel is a pre-built spreadsheet that tracks fuel purchases, mileage, and cost per…
- Excel Power Query: Add Leading Zeros to TextTo add leading zeros in Excel Power Query, create a custom column with Text.PadStart(Text.From([Code]), 6, "0"), replacing Code…
- Microsoft Excel Insert Page Break: A Practical GuideTo insert a page break in Microsoft Excel for Microsoft 365 on Windows, select the cell below and…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.