Excel SUM Formula: Complete Guide with Examples and Shortcuts
Master the Excel SUM formula — basic syntax, SUMIF, SUMIFS, SUMPRODUCT, AutoSum, and common errors. Step-by-step examples for beginners and intermediate users.

The SUM formula is the most used function in Microsoft Excel, and with good reason: adding up a column of numbers is the single most common calculation anyone needs a spreadsheet to perform. Whether you're totalling a list of expenses, calculating a monthly budget, or summing thousands of rows of sales data, SUM is the starting point. It's also the gateway to Excel's more powerful conditional summation functions — SUMIF, SUMIFS, and SUMPRODUCT — which can filter and sum data based on criteria rather than just adding every number in a range.
Understanding SUM deeply, rather than just knowing it exists, means you can write formulas that are fast, flexible, and reliable. Knowing when to use basic SUM versus SUMIF versus a more complex SUMPRODUCT changes how you build spreadsheets from the ground up. And knowing what breaks a SUM formula — text stored as numbers, merged cells, hidden rows — helps you avoid the silent errors that produce wrong totals without any warning.
This guide covers everything: the basic SUM syntax, how to sum non-contiguous ranges, how SUMIF and SUMIFS add conditional filtering, how to use AutoSum for instant totals, and the most common reasons a SUM formula returns zero or an error when it shouldn't. Examples are included throughout, with the formulas written exactly as you'd type them into Excel.
Excel's SUM function works the same across Excel for Windows, Excel for Mac, and Excel Online. If you're creating a spreadsheet from scratch and want to get your data organized before adding formulas, the guide on how to how to add drop down list in excel shows how to set up validated data entry in the columns you'll be summing — a useful step before you rely on SUM to produce accurate totals.
If you've only ever used SUM to add a column of numbers, you're using about 20% of its potential. By the end of this guide, you'll be writing SUMIF formulas that summarize data by category in seconds, SUMIFS formulas that filter across multiple columns simultaneously, and 3D SUM formulas that aggregate data from multiple worksheets. These skills transform how you build summary reports and dashboards — instead of manually copying and pasting subtotals, your spreadsheet calculates them automatically the moment new data arrives.
The SUM function also works inside other functions. =IF(SUM(A1:A10)>1000,"Over budget","On track") displays a budget status message based on the sum. =AVERAGE(SUM(A1:A5),SUM(B1:B5)) averages two section totals. =ROUND(SUM(C1:C10),2) rounds a sum to two decimal places. Nesting SUM inside other functions is a fundamental technique for building formulas that go beyond simple totals to produce calculated, conditional, and formatted results in a single cell.
Basic syntax: =SUM(number1, [number2], ...) — where numbers can be individual cells, ranges, or literal values.
AutoSum shortcut: Alt+= (Windows) or Cmd+Shift+T (Mac) instantly inserts =SUM() with the range above the active cell automatically detected.
Max arguments: SUM accepts up to 255 separate arguments. A single range counts as one argument regardless of how many cells it contains.
The basic SUM formula takes one or more arguments. =SUM(A1:A10) adds all values in cells A1 through A10. =SUM(A1,A5,A10) adds only those three specific cells. =SUM(A1:A10,C1:C10) adds all values in both ranges together. You can mix ranges and individual cells in a single SUM: =SUM(A1:A5,B2,C1:C3) is valid and adds everything specified. SUM ignores empty cells and cells containing text — they contribute zero to the total rather than causing an error.
Summing non-contiguous ranges is where SUM's flexibility shows. Instead of writing separate SUM formulas for each section and then adding those together, you can reference all the separate ranges inside one SUM call. =SUM(A1:A10,A15:A25,A30:A40) is cleaner than =SUM(A1:A10)+SUM(A15:A25)+SUM(A30:A40), produces the same result, and is easier to audit. When ranges are large or numerous, using a helper column to consolidate data before summing is often cleaner, but for a moderate number of sections, a multi-range SUM is efficient.
The AutoSum feature inserts a SUM formula automatically. Click the cell directly below a column of numbers (or directly to the right of a row of numbers) and press Alt+= on Windows or Cmd+Shift+T on Mac. Excel detects the contiguous range of numbers above or to the left and inserts the SUM formula pre-filled. You can then adjust the range if Excel's guess was incorrect. AutoSum also works on multiple columns or rows simultaneously: select a row of cells below multiple columns and press Alt+= to insert a SUM formula in each cell at once.
One subtle but important behaviour: SUM skips text cells silently. If your "number" column contains cells formatted as text that visually look like numbers, SUM produces a lower total than expected without flagging any error. The cells look right, the formula looks right, but the result is wrong. This happens frequently when data is imported or pasted from another system.
To check, select a suspicious cell and look at the format indicator in the Home tab ribbon — if it says "Text," that's the problem. You can fix it by selecting the column, going to Data > Text to Columns, and clicking Finish without changing any settings. This converts text-formatted numbers back to actual numbers.
Relative versus absolute references matter in SUM formulas that get copied. If you write =SUM(C2:C10) in cell D10 and copy the formula to E10, it adjusts to =SUM(D2:D10) because the reference is relative. If you wanted the range to stay fixed regardless of where you copy the formula, you'd write =SUM($C$2:$C$10) with dollar signs locking both the column and the row.
A mixed reference like =SUM($C2:$C10) locks the column but not the rows — useful when copying a formula across columns while keeping it pointed at column C. Understanding this distinction prevents the classic mistake of copying a total formula and discovering it's summing the wrong range.
Keyboard efficiency makes a big difference when working with SUM formulas repeatedly. After selecting a range, pressing F4 cycles through absolute and relative reference modes (A1 → $A$1 → A$1 → $A1 → A1). When building a SUMIF formula, you can type the function name and then click to select ranges directly in the spreadsheet rather than typing cell addresses — Excel fills in the range reference as you select. For complex formulas with multiple arguments, pressing Ctrl+Shift+A after typing the function name inserts all argument placeholders so you can see exactly what each position requires.
When building a reporting spreadsheet for others to use, it's good practice to put SUM totals in a clearly designated row at the bottom of each section — typically bolded and with a top border to visually separate totals from detail rows. Using Excel's Table feature (Ctrl+T) automatically adds a Total Row toggle to the bottom of the table, which inserts a SUBTOTAL function (not SUM) that respects any active filters.
You can switch the function from SUBTOTAL to other aggregates (average, count, max) using the dropdown that appears in the Total Row. This built-in total row is the cleanest way to add totals to a data table without manually maintaining a SUM formula row.

SUM Function Variants at a Glance
Adds all values in a range or list of arguments. Ignores text and blanks. Syntax: =SUM(range). Use it for any unconditional total — all expenses, all revenue, all quantities.
Adds values in a range that meet a single condition. Syntax: =SUMIF(criteria_range, criteria, sum_range). Example: =SUMIF(B:B,"Food",C:C) sums column C where column B equals Food.
Adds values meeting multiple conditions simultaneously. Syntax: =SUMIFS(sum_range, criteria1_range, criteria1, [criteria2_range, criteria2]...). Use when you need to filter by more than one column.
Multiplies corresponding values in arrays and sums the results. Also doubles as a flexible SUMIFS replacement. Syntax: =SUMPRODUCT(array1, array2). Handles complex multi-condition sums without array formulas.
SUMIF adds a filtering layer to SUM. The syntax is =SUMIF(criteria_range, criteria, sum_range). The criteria_range is the column you want to filter on. The criteria is what you're looking for. The sum_range is the column you want to add up when the filter matches. A budget spreadsheet with dates in column A, categories in column B, and amounts in column C could use =SUMIF(B:B,"Groceries",C:C) to sum only grocery expenses. Change "Groceries" to a cell reference — say, F1 — and you can create a dynamic summary table that recalculates based on whatever category you type into F1.
SUMIFS extends SUMIF to multiple conditions. =SUMIFS(C:C,B:B,"Groceries",A:A,">="&DATE(2026,1,1)) sums column C where column B is Groceries AND column A is on or after January 1, 2026. You can add as many criteria pairs as you need. Note the syntax difference: in SUMIF, the sum_range is the last argument; in SUMIFS, it's the first argument. This trips up experienced users when they first switch between the two functions. Double-check which function you're using and which argument comes first whenever you see a SUMIF that's returning strange results.
Combining SUMIFS with structured tables makes formulas much easier to read. If your data is in a Table (Insert > Table or Ctrl+T), you can reference named columns instead of column letters: =SUMIFS(Expenses[Amount],Expenses[Category],"Groceries") is far more readable than =SUMIFS(C:C,B:B,"Groceries") and updates automatically if you add or remove columns. Using excel drop down list validation in the category column ensures that every entry matches a consistent list, which means your SUMIF criteria will always find exactly the records you intend and won't silently miss rows because of typos like "Grocery" vs. "Groceries."
SUMPRODUCT is the most flexible summation function in Excel. At its simplest, =SUMPRODUCT(A1:A5, B1:B5) multiplies each pair of cells and sums the products — useful for weighted averages and revenue calculations (units × price). But SUMPRODUCT can also replicate SUMIFS logic using arrays of TRUE/FALSE values: =SUMPRODUCT((B2:B100="Groceries")*(C2:C100)) is equivalent to =SUMIF(B2:B100,"Groceries",C2:C100). The advantage of SUMPRODUCT is that it can handle conditions that SUMIFS can't — like checking whether a cell is not blank, or using OR logic rather than AND logic. =(SUMPRODUCT((B2:B100="Groceries")+(B2:B100="Dining"))*(C2:C100)) sums expenses that are either Groceries or Dining in a single formula, something SUMIFS can't do directly.
One advanced pattern worth knowing: using SUMIFS with date arithmetic. To sum transactions from the last 30 days, use =SUMIFS(C:C,A:A,">="&TODAY()-30). The TODAY() function returns today's date as a serial number, subtracting 30 gives you 30 days ago, and the ">=" with the ampersand builds the comparison string dynamically. Every time you open the spreadsheet, TODAY() updates and the SUMIFS recalculates automatically — a rolling 30-day sum without ever changing the formula. The same pattern works for year-to-date sums: =SUMIFS(C:C,A:A,">="&DATE(YEAR(TODAY()),1,1)) sums everything from January 1 of the current year through today.
A practical workflow tip: build your SUMIF formulas in a summary table separate from your raw data. Put category names in one column and a SUMIF formula in the adjacent column. This structure makes the spreadsheet self-documenting — anyone reading it can see exactly what each total represents — and makes it easy to add new categories simply by adding a new row to the summary table. The SUMIF formula in each row references the category cell in the same row, so the formula is identical in every cell and requires no customization per row.

Common SUM Formula Scenarios
Budget spreadsheets are the classic SUM use case. Use =SUM(C2:C100) to total all expenses in a single list. Use =SUMIF(B:B,"Housing",C:C) to total expenses by category. Build a summary table where each row is a category, column F holds the category names, and column G holds the SUMIF formula referencing F. As you add new expenses to the main list, the summary updates automatically.
For monthly budget tracking, add a Month column (formatted as a date or a text label like "Jan") and use SUMIFS to filter by both category and month: =SUMIFS(C:C,B:B,"Food",D:D,"May"). Copy the formula across columns for each month to create a monthly breakdown table without any manual calculation. This is the most common pattern in personal finance spreadsheets and small business expense reports alike.
Excel SUM Facts

3D SUM lets you sum the same cell or range across multiple worksheets. If you have twelve monthly sheets (Jan, Feb, Mar, ... Dec) with sales data in cell B2 on each sheet, =SUM(Jan:Dec!B2) adds B2 across all sheets simultaneously. This is cleaner than writing =Jan!B2+Feb!B2+Mar!B2+... for each cell. The syntax places the sheet range before the cell reference, with a colon separating the first and last sheet names. All sheets between those names — including any sheets added in between — are automatically included.
Common SUM errors worth knowing: #VALUE! occurs when the range contains cells with errors (like #DIV/0! or #N/A) — wrap those cells in IFERROR before summing to suppress the problem. =SUMIF with a criteria argument that uses a comparison like ">100" needs the operator in quotes: =SUMIF(A:A,">100",B:B). Forgetting the quotes produces a wrong result without any error message, which is more dangerous than an obvious crash. SUMIFS criteria ranges must all be the same size — mismatched ranges produce #VALUE!.
A practical tip for large spreadsheets: name your SUM ranges to make formulas readable. Instead of =SUM(C2:C10000), name that range "TotalExpenses" in Formulas > Name Manager, then write =SUM(TotalExpenses). The formula reads like plain English, is easier to audit, and doesn't break if rows are inserted above or below the range.
Named ranges that reference full columns (like Column C entirely) are also maintenance-free — any new data you add to column C is automatically included in the SUM without formula changes. Using how to create a drop down list in excel validation alongside named-range SUMIF formulas creates a data entry system where input is constrained and totals are always accurate.
For data validation setups that pair naturally with SUM functions, creating a how to create drop down list in excel in category or classification columns ensures your SUMIF criteria always find exact matches. When free-text entry is allowed, users inevitably type "groceries" in some rows and "Groceries" with a capital G in others — SUMIF treats these as different values and your category totals come out wrong. Dropdown validation eliminates this problem at the source by restricting input to a predefined list.
Finally, the SUBTOTAL function deserves more attention than it usually gets. While SUBTOTAL(9, range) is the filtered-row SUM equivalent, SUBTOTAL also handles AVERAGE (1), COUNT (2), MAX (4), MIN (5), and other aggregate functions with the same filter-awareness. When you turn on AutoFilter for a table, all SUBTOTAL formulas in the sheet automatically update to reflect only visible rows. This makes SUBTOTAL formulas a better choice than SUM for any total row in a filterable table, even if you only rarely use filters — the flexibility costs nothing and prevents accidentally misleading totals when someone does apply a filter.
Performance is rarely a concern with SUM on modern hardware, but extremely large workbooks with thousands of volatile functions can slow down. If performance is an issue, calculate SUM once in a named cell and reference that cell in other formulas rather than recalculating the SUM multiple times.
For worksheets that won't change after a point in time — a monthly report, for example — pasting the results as values (Paste Special > Values Only) converts live formulas to static numbers, eliminating recalculation overhead and reducing file size. This is especially useful for archived historical data that nobody should change anyway.
SUM vs. SUMIF vs. SUMPRODUCT: Which to Use
- +Use basic SUM for any total that doesn't need filtering — it's the fastest and simplest
- +Use SUMIF for single-condition filtering — category totals, status filters, single-criteria rollups
- +Use SUMIFS for multiple simultaneous conditions — region + product + date range combinations
- +Use SUMPRODUCT for OR-logic conditions, weighted calculations, or cross-sheet array operations
- +Use SUBTOTAL(9,...) instead of SUM when you have filters active and only want to sum visible rows
- −SUMIF and SUMIFS can return wrong results silently if criteria ranges are mismatched or text-formatted
- −SUMPRODUCT is harder to read and debug, especially with complex array conditions
- −3D SUM across sheets breaks if sheets are moved, renamed, or reordered between the endpoint sheets
- −AutoSum guesses the range — always verify it selected the right cells before confirming
- −SUM with full-column references (entire column C) recalculates frequently and can slow large workbooks
Excel SUM Formula Questions and Answers
About the Author
Attorney & Bar Exam Preparation Specialist
Yale Law SchoolJames R. Hargrove is a practicing attorney and legal educator with a Juris Doctor from Yale Law School and an LLM in Constitutional Law. With over a decade of experience coaching bar exam candidates across multiple jurisdictions, he specializes in MBE strategy, state-specific essay preparation, and multistate performance test techniques.