For subtotal of a range, based on text, SUMIF function is used. In our example below, we try to elaborate the way step by step:
1- Type “=SUMIF” in a blank cell and select a range of cells that you want to be evaluated using text criteria.
4- Press “Enter” for the result.
5- For party B, repeat all steps mentioned above and select criteria “B” instead of “A” in the formula.