[Excel] Sum while...

Solved
Hello,

My issue:
[Excel] Can you sum cells as long as a certain value is not encountered?

For example, I have in my spreadsheet the Folder column and the Cost column.
I have several costs (differentiated by categories) per folder, so several rows with the same folder number but with different costs:

I'm looking for a way to sum the costs BY FOLDER; in fact, as long as I don't encounter a different folder value, I continue to sum the costs (i.e., I add a line to my sum). Then I restart the sum when I change folders, etc.

I would like to know if this is possible in Excel, or by some other means.

Thank you
Configuration: Windows XP Firefox 2.0.0.4

2 answers