ARUNTOT

=ARUNTOT(ar,k)

ar
any array, nonnumeric values will be considered 0's
k
integer, 0 or ignored , running total all the way down, k>0, every k rows, k<0 (-k), every other k-th row

array running total, 3 ways

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
860
Office Version
  1. 365
Platform
  1. Windows
ARUNTOT array running total, 3 ways, all the way down, every k rows, every other k-th row
Excel Formula:
=LAMBDA(ar,k,
    LET(n,ISNUMBER(ar),a,IF(n,ar,0),r,ROWS(a),x,IF(k,MIN(INT(ABS(k)),r),r),
       c,COLUMNS(a),s,SEQUENCE(r),q,QUOTIENT(s-1,x)+1,m,MOD(s-1,x)+1,
       y,IF(s>=TRANSPOSE(s),IF(k>=0,--(q=TRANSPOSE(q)),--(m=TRANSPOSE(m))),0),
       MMULT(y,a)
    )
)
LAMBDA 7.0.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAK
1sample=ARUNTOT(A2:A21,)=ARUNTOT(A2:A21,5)=ARUNTOT(A2:A21,-5)=SEQUENCE(,6)^0-1+SEQUENCE(12)=ARUNTOT(J2#,)sample=ARUNTOT(X2:AC13,)
21111sample111111111111111111111111
323322D array222222333333222222333333
4a3303333336666663aaa3333636666
5477444444410101010101044444410710101010
6512125555555151515151515555555151215151515
711312666666212121212121666fgh66211821152121
821534777777282828282828777777282528222828
9b1530888888363636363636888888363336303636
10419789999994545454545459999xx9454245393645
115241210101010101010555555555555101010101010555255494655
1212513111111111111666666666666111111111111666366605766
1322736121212121212787878787878121212121212787578726978
14c2730
15431712=ARUNTOT(J2#,4)=ARUNTOT(J2#,-4)=ARUNTOT(X2:AC13,4)=ARUNTOT(X2:AC13,-4)
165361215111111111111111111111111
1713714333333222222333333222222
1823938666666333333636666303333
19d393010101010101044444410710101010444444
20443716555555666666555555666666
21548122011111111111188888811111151111888288
2218181818181810101010101018181812181810710101010
23262626262626121212121212262626202626121212121212
2499999915151515151599990915151515615
25191919191919181818181818191919191019181818121818
26303030303030212121212121303030302130211821212121
27424242424242242424242424424242423342242424242424
28
ARUNTOT post
Cell Formulas
RangeFormula
C1,E1,G1,J1,Q1,AE15,X15,Q15,J15,AE1C1=FORMULATEXT(C2)
C2:C21C2=ARUNTOT(A2:A21,)
E2:E21E2=ARUNTOT(A2:A21,5)
G2:G21G2=ARUNTOT(A2:A21,-5)
J2:O13J2=SEQUENCE(,6)^0-1+SEQUENCE(12)
Q2:V13Q2=ARUNTOT(J2#,)
AE2:AJ13AE2=ARUNTOT(X2:AC13,)
J16:O27J16=ARUNTOT(J2#,4)
Q16:V27Q16=ARUNTOT(J2#,-4)
X16:AC27X16=ARUNTOT(X2:AC13,4)
AE16:AJ27AE16=ARUNTOT(X2:AC13,-4)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,604
Messages
6,173,316
Members
452,510
Latest member
RCan29

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