Add numbers
Let's say you want to sum prices for all items not on sale in a store or sum gross profit margins for all departments under budget. There are several ways to add numbers.What do you want to do?
Add all contiguous numbers in a row or column
Add numbers based on one condition
Add numbers based on multiple conditions
Add numbers based on criteria stored in a separate range
Add numbers based on multiple conditions with the Conditional Sum Wizard
Add numbers in a cell
To do this task, use the + (plus sign) arithmetic operator.
For example, if you type the following formula in a cell:
=5+10
The cell displays the following result:
15
Add all contiguous numbers in a row or column
To do this task, use AutoSum
.
- Click a cell below the column of numbers or to the right of the row of numbers.
- On the
Hometab, in theEditinggroup, clickAutoSum
, and then press ENTER.
Add noncontiguous numbers
To do this task, use the SUM function.
Example
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example
- Create a blank workbook or worksheet.
- Select the example in the Help topic.
Note Do not select the row or column headers.
Selecting an example from Help
- Press CTRL+C.
- In the worksheet, select cell A1, and press CTRL+V.
- To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the
Formulastab, in theFormula Auditinggroup, click theShow Formulasbutton.
|
|
Note The SUM function can include up to 30 cell or range references.
Function details
Add numbers based on one condition
You can use the SUMIF function to create a total value for one range based on a value in another range, as in the following example.
Example
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example
- Create a blank workbook or worksheet.
- Select the example in the Help topic.
Note Do not select the row or column headers.
Selecting an example from Help
- Press CTRL+C.
- In the worksheet, select cell A1, and press CTRL+V.
- To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the
Formulastab, in theFormula Auditinggroup, click theShow Formulasbutton.
|
|
The SUMIF function uses the following arguments
Formula with SUMIF function
Range to evaluate: Check these cells to determine whether a row meets your criteria.
Criteria: The condition that the cells you evaluate must meet for the row to be included in the sum.
Range to sum: Add the numbers in these cells provided that the row satisfies the condition.
Function details
Add numbers based on multiple conditions
To do this task, use the IF and SUM functions.
Example
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example
- Create a blank workbook or worksheet.
- Select the example in the Help topic.
Note Do not select the row or column headers.
Selecting an example from Help
- Press CTRL+C.
- In the worksheet, select cell A1, and press CTRL+V.
- To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the
Formulastab, in theFormula Auditinggroup, click theShow Formulasbutton.
|
|
Note The formulas in the example must be entered as array formulas . After copying the example to a blank worksheet, select the formula cell. Press F2, and then press CTRL+SHIFT+ENTER. If the formula is not entered as an array formula, the error #VALUE! is returned.
Function details
Add numbers based on criteria stored in a separate range
To do this task, use the DSUM function.
Example
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example
- Create a blank workbook or worksheet.
- Select the example in the Help topic.
Note Do not select the row or column headers.
Selecting an example from Help
- Press CTRL+C.
- In the worksheet, select cell A1, and press CTRL+V.
- To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the
Formulastab, in theFormula Auditinggroup, click theShow Formulasbutton.
|
|
The DSUM function uses the following arguments.
Range to evaluate: The list from which you want to sum.
Field: The label of the column to sum.
Criteria: The range of cells that contains the conditions.
Function details
Add numbers based on multiple conditions with the Conditional Sum Wizard
If you want to summarize a range of cells based on specific conditions, you can use the Conditional Sum Wizard. For example, if your range of cells contain sales amounts for different salespeople, the Conditional Sum Wizard add-in program can help you create a formula that calculates the total sales amount for one salesperson.
- Click a cell in the range of cells.
- On the
Formulastab, in theSolutionsgroup, clickConditional Sum.If the
Conditional Sumcommand orSolutionstab are not available, then you need to load the Conditional Sum Wizard add-in program.Install and load the Conditional Sum Wizard add-in program
- Click the
Microsoft Office Button
, click Excel Options, and then click theAdd-inscategory. - Select
Excel Add-insin theManagelist box, and then clickGo. - In the Add-Ins available list, select the Conditional Sum Wizard check box, and then click OK.
- Click the
- Follow the instructions in the wizard.
Note The formulas created by the Conditional Sum Wizard are array formulas . After you edit these formulas, you must press CTRL+SHIFT+ENTER to lock in the formulas.
Add unique values
To do this task, use the SUM, IF, and FREQUENCY functions.
The following example uses the:
- FREQUENCY function to identify the unique values. For the first occurrence of a specific value, this function returns a number equal to the number of occurrences of that value. For each occurrence of that same value after the first, this function returns a 0 (zero).
- IF function to assign a value of 1 to each true condition.
- The SUM function to add the unique values.
Tip To see a function evaluated step by step, select the cell containing the formula, and then on the Formulas tab, in the Formula Auditing group, click Evaluate Formula.
Example
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example
- Create a blank workbook or worksheet.
- Select the example in the Help topic.
Note Do not select the row or column headers.
Selecting an example from Help
- Press CTRL+C.
- In the worksheet, select cell A1, and press CTRL+V.
- To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the
Formulastab, in theFormula Auditinggroup, click theShow Formulasbutton.
|
|
Note The formulas in this example must be entered as array formulas . Select each cell that contains a formula, press F2, and then press CTRL+SHIFT+ENTER.
Function details
![]()