Syntax
=SUMIF(range, criteria, [sum_range])Arguments
| Argument | Required | Description |
|---|---|---|
range | Required | The cells to check against the condition |
criteria | Required | The condition, like 5, ">10", "apple" or "a*" |
sum_range | Optional | The cells to add (the checked cells when left out) |
How to use SUMIF
SUMIF takes 2 required arguments and 1 optional argument. Type =SUMIF( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=SUMIF(A1:A4, ">160000")Result Data in the sheet
| A | |
|---|---|
| 1 | 100000 |
| 2 | 200000 |
| 3 | 300000 |
| 4 | 400000 |
=SUMIF(A1:A3, "x", B1:B3)Result Data in the sheet
| A | B | |
|---|---|---|
| 1 | x | 1 |
| 2 | y | 2 |
| 3 | x | 3 |
Related math functions
- SQRTReturns the square root of a number.
- SQRTPIReturns the square root of a number multiplied by pi.
- SUBTOTALReturns a subtotal (sum, average, count and more) of ranges, skipping other subtotals; codes 101 to 111 also skip hidden rows.
- SUMAdds numbers and the numbers in ranges.
- SUMIFSAdds the cells that meet all of several conditions.
- SUMPRODUCTMultiplies matching items of arrays or ranges and returns the sum of those products.
- SUMSQReturns the sum of the squares of the numbers.
- SUMX2MY2Returns the sum of the differences of the squares of matching values in two arrays.
- SUMX2PY2Returns the sum of the sums of the squares of matching values in two arrays.