# Excel Addition and Substraction

## Add numbers in a cell

To add numbers in a cell, use the + (plus sign) arithmetic operator. For example, if you type the formula"=105+210" in a cell, the cell displays the result as "315".

## Subtract numbers in a cell

Subtracting numbers in a cell is similar to adding numbers in cells. The + (plus sign) will be replaced by - (minus sign) in the formula. For example, if you type "=255-122" in a cell, the cell displays the result as 133

## Add all contiguous numbers in a row or column

To add all contiguous numbers in a row or column, use AutoSum icon available on the Standard toolbar.

1. Click a cell below the column of numbers or to the right of the row of numbers.
2. Click AutoSumon the Standard toolbar and then press ENTER.

## Add noncontiguous numbers

To add noncontiguous numbers use SUM function as shown in formula examples given below :

• =SUM(B2:B5, B8)    This formula adds numbers in the range B2 to B5 and number in cell B8.
• =SUM(B2,B5,B7)     This formula adds numbers in cells B2, B5 and B7.

Please See the above formulas in Formula bar and results in the cells in the images below:

Example 2
Example 1
To subtract noncontiguous numbers in rows or columns, put - (minus sign) before the number to be subtracted. If you the type the formula "=SUM(B2:B5,-B8)" in Example 1 above, the result will be displayed as 60. Similarly the formula "=SUM(B2,B5,-B7)" will display the result as 66.

## Add numbers based on one condition

To 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 3
Example 4

Please see the formulas for computing the sales of Mike and Dennis in Formula bar and results thereof in the selected cells in above images.

Syntax for SUMIF function:

SUMIF(range,criteria,sum_range)

• Range is the range of cells that you want evaluated by criteria.
• Criteria is the criteria in the form of a number, expression, or text that defines which cells will be added. For example, criteria can be expressed as 32, "32", ">32", or "apples".
• Sum_range are the actual cells to add if their corresponding cells in range match criteria. If sum_range is omitted, the cells in range are both evaluated by criteria and added if they match criteria.

## Add numbers based on multiple conditions

To add numbers based on multiple conditions, use the IF and SUM functions. Please look at the formula and the results in the example given below:

In the above example, the
Formula    " =SUM(IF((B2:B11="South")*(C2:C11="Coffee"),D2:D11)) "
gives sum of Coffee sales in South region.

If you want to know the sum of Total sales in South and North regions, the formula will be
" =SUM(IF((B2:B11="South")+(B2:B11="North"),D2:D11)) "

Important :The formulas in the above example must be entered as array formulas (array formula: A formula that performs multiple calculations on one or more sets of values, and then returns either a single result or multiple results. Array formulas are enclosed between braces { } and are entered by pressing CTRL+SHIFT+ENTER.). To enter an array formula Press F2 and then press CTRL+SHIFT+ENTER. If the formula is not entered as an array formula, the error #VALUE! is returned.