# Formula to SUM quantities then start over when value reached

#### aprice

##### New Member
I need to count inventory so that I always order a new case of foam filler when one is sold. There are 15 bags in a case. Some weeks we don't sell any bags, and some weeks we sell anywhere from 1 to all 15 bags. What I need to figure out is how to sum down a column so that every time the sum equals or exceeds 15, the spreadsheet adds 1 to the number of cases sold as if that week. I cannot figure it out. I have tried using MOD(C2,15) and variations of that, but it isn't working correctly.

The data looks like this:
 Column A Week # z Column B (I want a column showing Cases Sold) Column C Bags Sold 1 3 2 0 3 5 4 (I want a 1 here) 9 5 0 6 2 7 5 8 (I want another 1 here) 8 9 (at this point I have 10 bags sold out of the case of 15, so the count just carries on down) 8

<tbody>
</tbody>

Thank you for taking a look at this for me.
~Audrey

### Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

#### Tetra201

##### MrExcel MVP
Try putting the following formula in cell B2 and copying it down:

=IFERROR(1/(1/(INT(SUM(\$C\$2:\$C2)/15)-INT(SUM(\$C\$1:\$C1)/15))),"")

#### aprice

##### New Member
Try putting the following formula in cell B2 and copying it down:

=IFERROR(1/(1/(INT(SUM(\$C\$2:\$C2)/15)-INT(SUM(\$C\$1:\$C1)/15))),"")

That's it EXACTLY!!! You are my hero! Thank you!
Can you explain to me what the formula says? I know the "If there's an error...don't do anything" part. What does the (1/(1/(INT... mean? Isn't that the running total formula (SUM(\$C\$1:C1)? I think tried something similar.
Again, thank you!

Replies
22
Views
377
Replies
30
Views
814
Replies
9
Views
307
Replies
3
Views
110
Replies
0
Views
340

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,867
Messages
5,834,096
Members
430,260
Latest member
MANICX100

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back