Schnuusflaffen
Schnuusflaffen

Reputation: 33

Sum rows until customer number changes

How can I sum the rows of product sales 1-3, until the Customer Code changes? Then the next Customer sales should be summed up. There may be customers with only 1 or 2 products also.

enter image description here

Upvotes: 0

Views: 590

Answers (2)

Dominique
Dominique

Reputation: 17555

This is exactly the reason why the subtotals feature has been invented. Hereby a screenshot (not in English, sorry):

enter image description here

Here is the URL of the official documentation.

Upvotes: 3

Hiibb
Hiibb

Reputation: 383

If you have CustomerId in column A and Sales in column B, you could add an extra column C with formula:

=IF(A2=A1,C1+B2,B2)

And then drag it down.

Excel picture

Upvotes: 3

Related Questions