Sum if
SUMIF Function¶
The SUMIF function in Excel sums the values in a range that meet specified criteria. It's particularly useful for adding up numbers in a range where certain conditions are met.
Syntax:¶
SUMIF(range, criteria, [sum_range])
- range: The range of cells you want evaluated by your criterion.
- criteria: The condition that determines which cells will be added. This can be a number, expression, cell reference, or text that defines which cells will be summed.
- sum_range (optional): The actual cells to sum if they meet the criteria in
range. If omitted, Excel sums the cells inrangethat meet the criteria.
Examples:¶
=SUMIF(A1:A10, ">20")would sum all numbers in the rangeA1:A10that are greater than 20.=SUMIF(B1:B10, "Apples", C1:C10)would sum all the values inC1:C10where the corresponding cells inB1:B10contain the word "Apples".=SUMIF(A1:A10, D1, B1:B10)would sum all the values inB1:B10where the corresponding cells inA1:A10match the value inD1.
Usage Notes:¶
SUMIFcan be used for basic conditions, such as summing values that are greater than, less than, equal to, or not equal to a specified value.- It's important to ensure that
rangeandsum_rangeare of the same size and shape, otherwise, the function may return unexpected results.
Note: For more complex conditions involving multiple criteria, the
SUMIFSfunction (which handles multiple criteria) can be used.