**Sum By Group**

*Figure 1. Sum by group*

**General formula**

`=IF(A5=A4,"",SUMIF(B:B,B5,C:C))`

**Justification**

To calculate the total items by groups, corresponding in the table, you’ll use a formula relevance to SUMIF function.

The example below, the formula used in C5 is:

`=IF(A7=A8,"",SUMIF(A:A,A8,B:B))`

*Figure 2. Example 1** Sum by group*

**Note:** data should be arranged by grouping the column to induce reasonable results.

**How the formula works**

This formula work if supported by the IF function, which checks every value in column B to examine if it’s an equivalent because of the value within the cell. when values are equivalent, the formula will return nothing (“”). But if the values are completely different, the IF function prompt the:

`SUMIF(A:A,A8,B:B)`

In every row wherever SUMIF is prompt by IF, SUMIF evaluate the total value of all equivalent rows in column B (B:B). the factors utilized by SUMIF is that the present row quantity of column B (B5), checked against all of column “product” A(A:A).

Full column references like this are stylish and cool, since you do not need to feel worried concerning where the data starts and ends, but you just need to make sure there are no further data preceding or succeeding the table that will get caught by SUMIF.

## Leave a Comment