To use the SUMIF function in Excel to add values based on a specific condition, follow these steps:
- Open Excel and determine the range of cells containing values you want to evaluate.
- Decide on the condition or criteria that the values must meet in order to be included in the calculation.
- Determine the range of cells that contain the corresponding criteria for the condition.
- Select an empty cell where you want the sum result to be displayed.
- Type the SUMIF function into the selected cell, starting with the equal sign (=).
- 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.
- In the function, replace the placeholders "range", "criteria", and "sum_range" with the actual cell references or ranges.
- 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.
- Select an empty cell, let's say C1.
- Type =SUMIF(A1:A10, ">5", B1:B10).
- 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.