sum function that will reset the running total every after 5 counts

ExcelNewbie2020

Active Member
Joined
Dec 3, 2020
Messages
322
Office Version
  1. 365
Platform
  1. Windows
Cell J3 i have the counts of all the names in column B that reset every after 5 counts..
I need a formula in column K that will reset the running total per name after 5 counts..

For example in Name 1 its total count is 8, since it reset the count after 5 counts, it will only have the total counts of 3 and the running balance will be coming from the last 3 instances
07-07-24​
Name1​
41​
09-07-24​
Name1​
19​
10-07-24​
Name1​
32​


Book3
ABCDEFGHIJK
1DateNameAmountFormula here
201-07-24Name116nameCountAmount
301-07-24Name235Name1392
401-07-24Name323Name23108
501-07-24Name444Name3343
601-07-24Name515Name4487
701-07-24Name619Name54114
801-07-24Name722Name6394
901-07-24Name816Name7254
1001-07-24Name924Name8485
1101-07-24Name1016Name95133
1202-07-24Name145Name10397
1302-07-24Name219
1402-07-24Name350
1502-07-24Name437
1602-07-24Name523
1702-07-24Name646
1803-07-24Name238
1903-07-24Name338
2003-07-24Name429
2103-07-24Name526
2203-07-24Name614
2303-07-24Name727
2403-07-24Name1036
2504-07-24Name144
2604-07-24Name210
2704-07-24Name327
2804-07-24Name411
2904-07-24Name521
3004-07-24Name636
3104-07-24Name721
3204-07-24Name846
3304-07-24Name927
3404-07-24Name1045
3505-07-24Name143
3605-07-24Name231
3705-07-24Name332
3805-07-24Name442
3905-07-24Name512
4005-07-24Name626
4105-07-24Name745
4205-07-24Name931
4306-07-24Name428
4406-07-24Name543
4506-07-24Name631
4606-07-24Name740
4706-07-24Name811
4806-07-24Name915
4906-07-24Name112
5007-07-24Name141
5107-07-24Name223
5207-07-24Name310
5307-07-24Name410
5407-07-24Name515
5507-07-24Name641
5607-07-24Name728
5707-07-24Name936
5808-07-24Name622
5908-07-24Name726
6008-07-24Name812
6109-07-24Name119
6209-07-24Name237
6309-07-24Name311
6409-07-24Name435
6509-07-24Name523
6610-07-24Name132
6710-07-24Name248
6810-07-24Name322
6910-07-24Name414
7010-07-24Name533
Sheet7
Cell Formulas
RangeFormula
I3:I12I3=UNIQUE(B2:B70)
J3:J12J3=IF(MOD(COUNTIF($B$2:$B$100,UNIQUE(B2:B70)),5)=0,5,MOD(COUNTIF($B$2:$B$100,UNIQUE(B2:B70)),5))
Dynamic array formulas.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try:
Excel Formula:
=SUM(TAKE(FILTER($C$2:$C$70,$B$2:$B$70=I3),-J3))

You can use LET for the count in J:
Excel Formula:
=LET(m,MOD(COUNTIF(B2:B70,I3#),5),IF(m,m,5))
 
Upvote 0
Solution
Try:
Excel Formula:
=SUM(TAKE(FILTER($C$2:$C$70,$B$2:$B$70=I3),-J3))

You can use LET for the count in J:
Excel Formula:
=LET(m,MOD(COUNTIF(B2:B70,I3#),5),IF(m,m,5))
that worked..i make it complicated by thinking of resetting it when i can just take the last instances.. thanks man, really appreciated
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top