SUMIF
Returns the sum of all cell values in a cell-range which meet a given criterion. To specify multiple criteria please use SUMIFS.
Syntax
=SUMIF(DataRange, Criterion, [SumRange])
Arguments
| Name | Type | Description | 
|---|---|---|
| DataRange | Range | Cell-range to calculate sum for. | 
| Criterion | String | The criterion each cell has to fulfill. | 
| SumRange (optional) | Range | If given these cells are used to calculate total sum. If omitted DataRange is used. | 
Return
| Type | Description | 
|---|---|
| Number | The sum of all cell values which meet criterion. | 
Examples
| A | B | |
|---|---|---|
| 1 | 100000 | 200 | 
| 2 | 200000 | 400 | 
| 3 | 300000 | 400 | 
| 4 | North | 600 | 
| 5 | East | 800 | 
| 6 | South | 1000 | 
| Formula | Result | Comment | 
|---|---|---|
 | 300000 | Only cells A1 and A2 match given criterion. | 
 | 1600 | Take cells from column A which end with "th" and average corresponding values from column B. |