Xlambda
Well-known Member
- Joined
- Mar 8, 2021
- Messages
- 860
- Office Version
- 365
- Platform
- 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 | |||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | AH | AI | AJ | AK | |||
1 | sample | =ARUNTOT(A2:A21,) | =ARUNTOT(A2:A21,5) | =ARUNTOT(A2:A21,-5) | =SEQUENCE(,6)^0-1+SEQUENCE(12) | =ARUNTOT(J2#,) | sample | =ARUNTOT(X2:AC13,) | |||||||||||||||||||||||||||||||
2 | 1 | 1 | 1 | 1 | sample | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | ||||||||||
3 | 2 | 3 | 3 | 2 | 2D array | 2 | 2 | 2 | 2 | 2 | 2 | 3 | 3 | 3 | 3 | 3 | 3 | 2 | 2 | 2 | 2 | 2 | 2 | 3 | 3 | 3 | 3 | 3 | 3 | ||||||||||
4 | a | 3 | 3 | 0 | 3 | 3 | 3 | 3 | 3 | 3 | 6 | 6 | 6 | 6 | 6 | 6 | 3 | aaa | 3 | 3 | 3 | 3 | 6 | 3 | 6 | 6 | 6 | 6 | |||||||||||
5 | 4 | 7 | 7 | 4 | 4 | 4 | 4 | 4 | 4 | 4 | 10 | 10 | 10 | 10 | 10 | 10 | 4 | 4 | 4 | 4 | 4 | 4 | 10 | 7 | 10 | 10 | 10 | 10 | |||||||||||
6 | 5 | 12 | 12 | 5 | 5 | 5 | 5 | 5 | 5 | 5 | 15 | 15 | 15 | 15 | 15 | 15 | 5 | 5 | 5 | 5 | 5 | 5 | 15 | 12 | 15 | 15 | 15 | 15 | |||||||||||
7 | 1 | 13 | 1 | 2 | 6 | 6 | 6 | 6 | 6 | 6 | 21 | 21 | 21 | 21 | 21 | 21 | 6 | 6 | 6 | fgh | 6 | 6 | 21 | 18 | 21 | 15 | 21 | 21 | |||||||||||
8 | 2 | 15 | 3 | 4 | 7 | 7 | 7 | 7 | 7 | 7 | 28 | 28 | 28 | 28 | 28 | 28 | 7 | 7 | 7 | 7 | 7 | 7 | 28 | 25 | 28 | 22 | 28 | 28 | |||||||||||
9 | b | 15 | 3 | 0 | 8 | 8 | 8 | 8 | 8 | 8 | 36 | 36 | 36 | 36 | 36 | 36 | 8 | 8 | 8 | 8 | 8 | 8 | 36 | 33 | 36 | 30 | 36 | 36 | |||||||||||
10 | 4 | 19 | 7 | 8 | 9 | 9 | 9 | 9 | 9 | 9 | 45 | 45 | 45 | 45 | 45 | 45 | 9 | 9 | 9 | 9 | xx | 9 | 45 | 42 | 45 | 39 | 36 | 45 | |||||||||||
11 | 5 | 24 | 12 | 10 | 10 | 10 | 10 | 10 | 10 | 10 | 55 | 55 | 55 | 55 | 55 | 55 | 10 | 10 | 10 | 10 | 10 | 10 | 55 | 52 | 55 | 49 | 46 | 55 | |||||||||||
12 | 1 | 25 | 1 | 3 | 11 | 11 | 11 | 11 | 11 | 11 | 66 | 66 | 66 | 66 | 66 | 66 | 11 | 11 | 11 | 11 | 11 | 11 | 66 | 63 | 66 | 60 | 57 | 66 | |||||||||||
13 | 2 | 27 | 3 | 6 | 12 | 12 | 12 | 12 | 12 | 12 | 78 | 78 | 78 | 78 | 78 | 78 | 12 | 12 | 12 | 12 | 12 | 12 | 78 | 75 | 78 | 72 | 69 | 78 | |||||||||||
14 | c | 27 | 3 | 0 | |||||||||||||||||||||||||||||||||||
15 | 4 | 31 | 7 | 12 | =ARUNTOT(J2#,4) | =ARUNTOT(J2#,-4) | =ARUNTOT(X2:AC13,4) | =ARUNTOT(X2:AC13,-4) | |||||||||||||||||||||||||||||||
16 | 5 | 36 | 12 | 15 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | |||||||||||
17 | 1 | 37 | 1 | 4 | 3 | 3 | 3 | 3 | 3 | 3 | 2 | 2 | 2 | 2 | 2 | 2 | 3 | 3 | 3 | 3 | 3 | 3 | 2 | 2 | 2 | 2 | 2 | 2 | |||||||||||
18 | 2 | 39 | 3 | 8 | 6 | 6 | 6 | 6 | 6 | 6 | 3 | 3 | 3 | 3 | 3 | 3 | 6 | 3 | 6 | 6 | 6 | 6 | 3 | 0 | 3 | 3 | 3 | 3 | |||||||||||
19 | d | 39 | 3 | 0 | 10 | 10 | 10 | 10 | 10 | 10 | 4 | 4 | 4 | 4 | 4 | 4 | 10 | 7 | 10 | 10 | 10 | 10 | 4 | 4 | 4 | 4 | 4 | 4 | |||||||||||
20 | 4 | 43 | 7 | 16 | 5 | 5 | 5 | 5 | 5 | 5 | 6 | 6 | 6 | 6 | 6 | 6 | 5 | 5 | 5 | 5 | 5 | 5 | 6 | 6 | 6 | 6 | 6 | 6 | |||||||||||
21 | 5 | 48 | 12 | 20 | 11 | 11 | 11 | 11 | 11 | 11 | 8 | 8 | 8 | 8 | 8 | 8 | 11 | 11 | 11 | 5 | 11 | 11 | 8 | 8 | 8 | 2 | 8 | 8 | |||||||||||
22 | 18 | 18 | 18 | 18 | 18 | 18 | 10 | 10 | 10 | 10 | 10 | 10 | 18 | 18 | 18 | 12 | 18 | 18 | 10 | 7 | 10 | 10 | 10 | 10 | |||||||||||||||
23 | 26 | 26 | 26 | 26 | 26 | 26 | 12 | 12 | 12 | 12 | 12 | 12 | 26 | 26 | 26 | 20 | 26 | 26 | 12 | 12 | 12 | 12 | 12 | 12 | |||||||||||||||
24 | 9 | 9 | 9 | 9 | 9 | 9 | 15 | 15 | 15 | 15 | 15 | 15 | 9 | 9 | 9 | 9 | 0 | 9 | 15 | 15 | 15 | 15 | 6 | 15 | |||||||||||||||
25 | 19 | 19 | 19 | 19 | 19 | 19 | 18 | 18 | 18 | 18 | 18 | 18 | 19 | 19 | 19 | 19 | 10 | 19 | 18 | 18 | 18 | 12 | 18 | 18 | |||||||||||||||
26 | 30 | 30 | 30 | 30 | 30 | 30 | 21 | 21 | 21 | 21 | 21 | 21 | 30 | 30 | 30 | 30 | 21 | 30 | 21 | 18 | 21 | 21 | 21 | 21 | |||||||||||||||
27 | 42 | 42 | 42 | 42 | 42 | 42 | 24 | 24 | 24 | 24 | 24 | 24 | 42 | 42 | 42 | 42 | 33 | 42 | 24 | 24 | 24 | 24 | 24 | 24 | |||||||||||||||
28 | |||||||||||||||||||||||||||||||||||||||
ARUNTOT post |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C1,E1,G1,J1,Q1,AE15,X15,Q15,J15,AE1 | C1 | =FORMULATEXT(C2) |
C2:C21 | C2 | =ARUNTOT(A2:A21,) |
E2:E21 | E2 | =ARUNTOT(A2:A21,5) |
G2:G21 | G2 | =ARUNTOT(A2:A21,-5) |
J2:O13 | J2 | =SEQUENCE(,6)^0-1+SEQUENCE(12) |
Q2:V13 | Q2 | =ARUNTOT(J2#,) |
AE2:AJ13 | AE2 | =ARUNTOT(X2:AC13,) |
J16:O27 | J16 | =ARUNTOT(J2#,4) |
Q16:V27 | Q16 | =ARUNTOT(J2#,-4) |
X16:AC27 | X16 | =ARUNTOT(X2:AC13,4) |
AE16:AJ27 | AE16 | =ARUNTOT(X2:AC13,-4) |
Dynamic array formulas. |
Upvote
0