To sum rows conditionally in Excel, you can use the SUMIF or SUMIFS function, depending on the complexity of your conditions. Here's a step-by-step guide using both functions:
### Using SUMIF:
1. **Syntax**:
```
=SUMIF(range, criteria, [sum_range])
```
- `range`: This is the range of cells that you want to evaluate based on a condition.
- `criteria`: This is the condition or criteria that must be met for the corresponding values to be included in the sum.
- `sum_range` (optional): This is the range of cells you want to add together. If omitted, the `range` is used.
2. **Example**:
Let's say you have data in columns A and B, and you want to sum the values in column B where the corresponding values in column A are greater than 5.
- In an empty cell, you'd enter:
```
=SUMIF(A:A, ">5", B:B)
```
### Using SUMIFS:
1. **Syntax**:
```
=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
```
- `sum_range`: This is the range of cells you want to add together.
- `criteria_range1`: This is the range of cells that you want to evaluate based on the first condition.
- `criteria1`: This is the condition that must be met in `criteria_range1`.
- `criteria_range2, criteria2` (optional): Additional ranges and criteria pairs can be added for more complex conditions.
2. **Example**:
Let's say you have data in columns A, B, and C. You want to sum the values in column C where the corresponding values in column A are greater than 5 and the values in column B are less than 10.
- In an empty cell, you'd enter:
```
=SUMIFS(C:C, A:A, ">5", B:B, "<10")
```
These are basic examples, and you can customize the conditions based on your specific requirements. Remember to adjust the ranges and criteria to match your data.