Using SUMIF Function
Use the SUMIF function to sum the values in a range that meet criteria that you specify.
Syntax
=SUMIF(range, criteria, [sum_range])
Range → The cells you want to test against your condition.
Criteria → The condition (what to match).
Sum_range (optional) → The cells to add up. If you skip this, Excel will sum the same cells in range.
Examples - Sum of the sales of all foods in the "Fruits" category.
Steps:
1. Enter Formula
Enter Formula
2. Press Enter to get the result.
Results