Arguments
number1- The first number or range to add.number2(optional) - Additional numbers or ranges.
Adds all the numbers in one or more ranges.
Syntax
=SUM(number1, [number2], …)number1 - The first number or range to add.number2 (optional) - Additional numbers or ranges.=SUM(B2:B100)Returns: Total of the range
The most common aggregation.
=SUM(B2:B10, D2:D10)Returns: Combined total of two ranges
SUM accepts several ranges at once.
SUM adds numbers. What makes it worth a reference page is that it does not add everything you hand it: the rules differ depending on whether a value arrives inside a range reference or as a value you typed directly into the formula. Inside a range, SUM looks at each cell and keeps only the ones that hold a real number. Text is skipped, TRUE and FALSE are skipped, empty cells are skipped. Typed directly as an argument, the same values are converted instead: =SUM("5", TRUE) is 6, because Excel assumes that if you wrote it into the formula yourself you meant it as a number.
That split is the source of the most common SUM complaint. A column imported from a CSV, a web page or an accounting system often holds numbers stored as text - the cells are left-aligned, and a green triangle may appear in the corner. SUM over that range returns 0 and gives no warning, because from its point of view the range contains no numbers at all. COUNT on the same range returns 0 too, which is the quickest way to confirm the diagnosis. The fix is to convert the data rather than to change the formula: select the column and run Data > Text to Columns > Finish, multiply the range by 1 with Paste Special, or add a helper column of =VALUE(A2).
SUM also behaves differently from the + operator when errors and text are involved. =A1+A2+A3 fails with #VALUE! if any of those cells holds text; =SUM(A1:A3) quietly ignores it. Both propagate a real error value: if any cell in the range contains #N/A or #DIV/0!, SUM returns that error, and you need SUM(IFERROR(...)) or AGGREGATE to step over it. For totals restricted by a condition, SUMIF and SUMIFS take over; SUM's only job is the unconditional total.
| Error | What it means and how to fix it |
|---|---|
| #VALUE! | A directly typed argument is text that cannot be converted, as in =SUM("total", B2). Text sitting inside a referenced range never causes this - it is silently skipped instead. Remove the literal or wrap it in VALUE. |
| #REF! | The range the formula pointed at was deleted, usually by removing rows or a whole sheet. Rewrite the reference; Undo immediately after the deletion is the cheapest fix. |
| #DIV/0!, #N/A or any other error | Not produced by SUM but passed through from a cell in the range. Find the offending cell, or total with =SUM(IFERROR(B2:B100, 0)) entered as an array formula in older versions. |
| #NAME? | SUM is misspelled, or a defined name inside the arguments does not exist. Check the name box for the range name you expected. |
=SUM(B2:B13) - SUM(C2:C13)Returns: Net figure
Two totals subtracted. Safer than =SUM(B2:B13, -C2:C13), which is not valid syntax for negating a range.
=SUM(Jan:Dec!B5)Returns: Cell B5 added across every sheet from Jan to Dec
A 3-D reference. The sheets must sit next to each other in the tab order, and any sheet moved between Jan and Dec is picked up automatically.
=SUM(VALUE(B2:B100))Returns: Total of a column stored as text
Converts before adding. In Excel 2019 and earlier this needs Ctrl+Shift+Enter; in 365 it just works. Any cell that is genuinely not a number turns the whole result into #VALUE!.
| Application | Support |
|---|---|
| Excel 2007-2016 | Supported. Argument limit is 255; each argument can still be a whole-column range. |
| Excel 2019 | Identical behaviour. |
| Excel 2021 / Microsoft 365 | Identical, and now commonly wrapped around dynamic arrays: =SUM(FILTER(...)) needs no Ctrl+Shift+Enter. |
| Google Sheets | Same rules, same text-in-a-range behaviour. Sheets marks numbers-as-text less obviously, so check with ISNUMBER. |
| LibreOffice Calc | Supported. Under Tools > Options > Calc > Formula, LibreOffice can be set to convert text in ranges to numbers, which makes it disagree with Excel on the same file. |
Yes. SUM uses the same syntax in Google Sheets and LibreOffice Calc, so you can paste these formulas straight across.
The ExcelTool editor implements SUM with one to any number of arguments and applies the same range-versus-argument split Excel does: values inside a referenced range count only when they are stored as numbers, while a scalar argument that is text is parsed and a scalar boolean counts as 1 or 0.
Its text parser accepts more than a bare numeral: leading and trailing spaces, a percent sign, thousands separators and a leading $, £, €, ¥ or ₹ are all understood, so =SUM("$1,200", 300) evaluates to 1500 rather than #VALUE!.
An error value found in any argument, whether a scalar or a cell inside a range, is returned immediately as the result of the whole SUM.
Calling SUM with no arguments at all returns #VALUE! in the editor, because the argument count is checked before the function runs.
You can try any of these formulas in the free in-browser spreadsheet editor - it opens .xlsx files, recalculates as you type, and needs no signup.
They are text, not numbers. Pasted HTML often carries the digits as a string, sometimes with a trailing non-breaking space. SUM skips every text cell inside a range without comment, so the total reads 0. Confirm with =COUNT(B2:B100) - if it returns 0 while the cells clearly contain figures, they are all text. Use Text to Columns on the column, or =VALUE(TRIM(SUBSTITUTE(B2, CHAR(160), " "))) in a helper column when a non-breaking space is involved.
The + operator coerces each operand and fails on text it cannot convert. SUM filters the range first and only adds what is already numeric. So a stray word in A2 breaks the addition chain but is invisible to SUM. That difference cuts both ways: SUM will happily under-report a total the + chain would have flagged.
Yes. Each argument is evaluated independently, so A5:A10 is added twice. Excel does not warn about overlapping arguments. Either split the ranges so they do not intersect, or use a single =SUM(A1:A15).
SUM has no error-skipping mode - a single #N/A in the range becomes the answer. In Excel 2007 and later use =AGGREGATE(9, 6, B2:B100), where 9 means SUM and 6 means ignore errors. Otherwise fix the source: wrap the lookups themselves in IFERROR so the column never holds an error to begin with.