Microsoft Office

What Does The Sum Function Do In Microsoft Excel

The SUM function in Microsoft Excel adds numbers and returns a total. You can use it for a column, a row, individual cells or several separate ranges. For example, =SUM(A1:A5) adds the numeric values from A1 through A5. It is useful for totalling expenses, sales.

Which licences fit your PC setup?

Prices are an AUD snapshot, not a live quote. Confirm variant and total on the listing.

How SUM formulas work

A SUM formula starts with an equals sign, followed by SUM and the values or references inside parentheses. A colon describes a continuous range: A1:A5 includes A1, A2, A3, A4 and A5. Commas separate individual arguments, such as two ranges you want to add together.

These examples show the main ways to write it:

  • =SUM(A1:A5) totals a vertical range.
  • =SUM(B2:F2) totals a horizontal range.
  • =SUM(A1,A3,A5) adds only the three specified cells.
  • =SUM(A1:A5,C1:C5) combines two separate ranges.

Microsoft's SUM function reference explains how numbers, cell references and ranges can be combined. For a worksheet you will update regularly, keep amounts in cells and reference them rather than embedding every amount in the formula.

Enter your first SUM formula

For an expense list in A1:A5, put the total beneath the list:

  1. Select A6, leaving the expense amounts in A1:A5.
  2. Type =SUM(A1:A5). Alternatively, type =SUM(, drag across the cells you need, then type the closing parenthesis.
  3. Press Enter to display the total.
  4. Select A6 again and check the range in the formula bar.

Keep the result cell outside the range being added. In this example, =SUM(A1:A6) in A6 would include its own result and create a circular reference.

The examples here use commas between arguments. Depending on your regional settings, Excel may require semicolons instead, such as =SUM(A1:A5;C1:C5).

If you use a Mac and double-clicking your workbook opens another application, follow the guide to setting Microsoft Excel as the default program on Mac before working through the examples.

Use AutoSum for a row or column

AutoSum inserts a SUM formula and suggests a nearby range. It saves typing, but you still need to check the selection. Microsoft's AutoSum instructions describe the process:

  1. Select the empty cell immediately below a column of numbers, or immediately to the right of a row.
  2. Choose AutoSum on the Home or Formulas tab.
  3. Check the highlighted cells. Adjust the range if Excel has missed part of the list or included unwanted cells.
  4. Press Enter to accept the formula.

Pay particular attention to lists with blank rows or separate blocks of figures. A suggested range may cover only one block. Also avoid adding a list of transactions together with an existing subtotal for those same transactions, which would count them twice.

Understand which cells contribute to the total

When SUM refers to a range, it ignores blank cells and text entries. A label such as “Expenses” within the range does not, by itself, cause a #VALUE! error. However, an amount stored as text can be skipped too, leaving a total that looks plausible but is incomplete.

If imported amounts are missing from the result, check whether Excel recognises them as numbers. Where Excel displays an error-checking warning for a number stored as text, use Convert to Number. Changing the displayed format alone may not convert the underlying value.

Error values behave differently from ordinary text. If a referenced cell contains an error such as #DIV/0! or #VALUE!, SUM can return that error. Correct the source cell rather than assuming SUM will ignore it.

Choose SUM, SUMIF, SUMIFS or SUBTOTAL

SUM adds the referenced values without testing conditions. Use a different function when your total should depend on categories or row visibility.

What you need Function Example
Total the selected range SUM =SUM(B2:B20)
Total amounts matching one condition SUMIF =SUMIF(A2:A20,"Travel",B2:B20)
Total amounts matching several conditions SUMIFS =SUMIFS(B2:B20,A2:A20,"Travel",C2:C20,"Approved")
Total a column while excluding filtered-out and manually hidden rows SUBTOTAL =SUBTOTAL(109,B2:B20)

In the conditional examples, column A contains categories and column B contains amounts. The SUMIFS example also checks approval status in column C. Notice that the sum range comes first in SUMIFS, whereas it comes after the condition in SUMIF. Microsoft's SUMIFS reference explains the argument order.

Hidden rows and filters

SUM includes referenced values even when their rows are hidden or filtered out. For a vertical list, =SUBTOTAL(109,B2:B20) excludes both filtered-out rows and manually hidden rows. Using 9 instead of 109 excludes filtered-out rows but includes manually hidden rows.

These options concern rows: hiding a column does not make SUBTOTAL exclude that column's values. See Microsoft's SUBTOTAL reference when deciding which visibility behaviour your report needs.

Use named ranges and references to other sheets

A named range can make a recurring calculation easier to read. Select your expense cells, choose Formulas, then Define Name, and assign a name such as Expenses. You can then write =SUM(Expenses). Check which cells the name refers to when your list changes.

To combine figures from different worksheets, include each sheet name before its range: =SUM(Sheet2!A1:A5,Sheet3!B1:B5). If a sheet name contains spaces, enclose it in single quotation marks, as in =SUM('January Sales'!B2:B20).

Check an unexpected result

  1. Inspect the formula's range. Check its first and last cells, any overlapping ranges and any subtotals included alongside detail rows.
  2. Check for numbers stored as text or errors in the source cells.
  3. Decide whether hidden or filtered rows belong in the total.
  4. Check that the result cell is outside every range it references. If Excel flags a problem, use the guide to resolving a circular reference in Excel.

For related workbook tasks, browse the Microsoft Office guides.

Now add a SUM formula beneath one list in your workbook, inspect its referenced cells and compare the result with a manual check of that list.

Other editions for separate workloads

Other editions for separate workloads; prices in AUD, confirm the total on the listing.

How to check this worked

  1. Open Settings, System, Activation and confirm the edition shown.
  2. Enter the key and run activation; expect a green tick within a minute.
  3. Reboot and re-check activation survives the restart.

FAQ

What else should you know before buying?

What do I need before starting?
Read the requirements and confirm the edition first; the steps assume the machine is compatible.
How do I know the licence is genuine?
Activate on Microsoft's servers and check Settings, System, Activation. A working activation is the test.
Is this a subscription?
Keys sold here are one-time lifetime licences. Microsoft 365 plans are billed by Microsoft instead.
What if the key fails?
Email hi@ms.codes with the order number and a screenshot. Replacement or refund applies within 30 days.

Check who prepared and reviewed this guide

Written by
MS.Codes editorial
Reviewed by
Support team

Last verified: (source review; see test status above).

Recent Post