How to use the SUMIF function to add values based on a specific condition in Excel?

To use the SUMIF function in Excel to add values based on a specific condition, follow these steps:

  1. Open Excel and determine the range of cells containing values you want to evaluate.
  2. Decide on the condition or criteria that the values must meet in order to be included in the calculation.
  3. Determine the range of cells that contain the corresponding criteria for the condition.
  4. Select an empty cell where you want the sum result to be displayed.
  5. Type the SUMIF function into the selected cell, starting with the equal sign (=).
  6. The syntax of the SUMIF function is as follows: SUMIF(range, criteria, [sum_range]).
    • "range" refers to the range of cells to be evaluated for the condition.
    • "criteria" refers to the condition that values must meet to be included in the calculation.
    • "sum_range" (optional) refers to the range of cells whose values will be added if they meet the condition. If omitted, the function will use the "range" parameter as the sum range.
  7. In the function, replace the placeholders "range", "criteria", and "sum_range" with the actual cell references or ranges.
  8. Press Enter to calculate the sum based on the specified condition.

Here's an example: Assume you have a range of values in cells A1 to A10, and you want to add only the values greater than 5. The corresponding criteria range would be B1 to B10.

  1. Select an empty cell, let's say C1.
  2. Type =SUMIF(A1:A10, ">5", B1:B10).
  3. Press Enter.

Excel will calculate and display the sum of all values in the range A1 to A10 that meet the condition (>5) and have a corresponding "TRUE" in the criteria range B1 to B10.