The SUMIF function returns the sum of values in a list that satisfy a specified condition.
SUMIF(list, condition, [range])
Returns the sum of values that satisfy the condition.
SUMIF([10, 20, 30, 40], ">20")
In this example, the SUMIF function returns the sum of values greater than 20 from the list and returns 70 (30 + 40).
SUMIF([10, 20, 30, 40], ">20", [1, 2, 3, 4])
The SUMIF function evaluates the values in the first list and returns the sum of corresponding values from the second list where the condition is met. In this example, the result is 7 (3 + 4).