ALARGESUM

=ALARGESUM(a)

a
strings of digits in a 1D vertical array

sums vertical array of large numbers

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
837
Office Version
  1. 365
Platform
  1. Windows
ALARGESUM !! recursive !! sums vertical array of large numbers, calls LARGESUM
Excel Formula:
=LAMBDA(a,
    LET(n,ROWS(a),x,INDEX(a,n),
       IF(n=1,a,LARGESUM(ALARGESUM(INDEX(a,SEQUENCE(n-1))),x))
    )
)
LAMBDA 6.0.xlsx
AB
167834563234560684256775322456780876839
2890746476745421097897675645434623145856
3765543422314343656765675858532125340988
4=ALARGESUM(A1:A3)
51724124462294325438920126826423529363683
6
ALARGESUM post
Cell Formulas
RangeFormula
A4A4=FORMULATEXT(A5)
A5A5=ALARGESUM(A1:A3)
 
Upvote 0
LARGE NR OP.xlsx
ABCDEFGHIJKL
1Chapter 1. ADDition. The functions. Part 4. Last part of ALSUM
2…,CONCAT(FILTER(d,SEQUENCE(,COLUMNS(d))>=XMATCH(TRUE,d<>0)))))
3
4(to simulate more leading columns with 0's)
5let's imagine an ipothetical "u" delivered by first part of ALSUM
648143134524539764321
7
8"d" variable (T_LA) will return this result:
9=T_LA(B6:G6)
100007834381
11as we expected, row array has to have single digits values
12(exit condition of recursive T_LS is met)
13
14index position of first value <>0
15=XMATCH(TRUE,B10#<>0)
164
17
18=FILTER(B10#,SEQUENCE(,COLUMNS(B10#))>=B16)
197834381
20
21=CONCAT(B19#)
227834381
23
ALADD 6
Cell Formulas
RangeFormula
B9,B21,B18,B15B9=FORMULATEXT(B10)
B10:K10B10=T_LA(B6:G6)
B16B16=XMATCH(TRUE,B10#<>0)
B19:H19B19=FILTER(B10#,SEQUENCE(,COLUMNS(B10#))>=B16)
B22B22=CONCAT(B19#)
Dynamic array formulas.
 
Chapter 1. ADDition.. Part 4. Examples, numbers as numbers (max 15 digits)
Introducing the iteration tool functions, I_T_LA and I_ALA, "designed" only to calculate total nr. of iterations performed by a specific calculation.
For that, we have to introduce a counter argument "i".
I_T_LA(a,[i ]) !!recursive!!
The only modifications made to main T_LA:
- from =LAMBDA(a,LET… to =LAMBDA(a,[i ],LET...
- from … IF(AND(LEN(u)=1),u,T_LA(u)))) to … IF(AND(LEN(u)=1),i,I_T_LA(u,i+1))))
Excel Formula:
=LAMBDA(a,[i ],
    LET(c,COLUMNS(a),l,LEN(a),m,MAX(l),r,SEQUENCE(m),s,SEQUENCE(,c+m-1)-r+1,
       u,MMULT(SEQUENCE(,m)^0,--IFERROR(INDEX(MID(REPLACE(a,1,0,REPT(0,m-l)),r+SEQUENCE(,c)^0-1,1),r,IF(s<1,-1,s)),0)),
      IF(AND(LEN(u)=1),i,I_T_LA(u,i+1))
    )
)
I_ALA(a)
Modifications made to main ALADD:
- removing last part, we need only to integrate I_T_LA that needs the values delivered by first part of ALADD
- from … d,T_LA(u) … to … I_T_LA(u)))
Excel Formula:
=LAMBDA(a,
    LET(l,LEN(a),m,MAX(l),u,MMULT(SEQUENCE(,ROWS(a))^0,--MID(REPLACE(a,1,0,REPT(0,m-l)),SEQUENCE(,m),1)),
      I_T_LA(u)
    )
)
Believe it or not, adding 1M numbers with max 15 digits was solved with only 4 (four) iterations !!!
LARGE NR OP.xlsx
ABCDEFGHIJKLMN
1Chapter 1. ADDition.. Part 4. Examples, numbers as numbers (max 15 digits)
2
3generating random array of numbers, 1M rows
4between 1 and 999999999999999 (15 digits)
5(beneath exponential notations, numbers are not modified)nr. iterations
6=RANDARRAY(1000000,,1,999999999999999,1)=ALADD(A7#)=I_ALA(A7#)
79.96681E+135000677762939097455614
86.68401E+14
96.10809E+14len checkaverage lenresult lenNote:
109.69488E+14=LEN(A7#)check=LEN(G7)How iterations are counted.
114.78344E+1314=AVERAGE(C11#)21If exit condition is met from the first
125.75494E+141514.88935time, will have 0 iterations.
138.92371E+1415
144.36856E+1415Examples=ALADD(H15:H16)=I_ALA(H15:H16)
154.08199E+1414123424680
167.97559E+14151234
171.94442E+1415
188.95554E+1415example used in post #9, we saw why another iteration was needed.
192.05022E+1415
206.1971E+1415=ALADD(H21:H33)=I_ALA(H21:H33)
212.11739E+14159999911109871
222.77154E+131599999
233.3819E+13159999
245.12099E+141599999
257.47727E+141599999
264.39849E+141499999
274.6711E+141499999
288.85025E+141599999
291.47571E+1315999
307.86417E+141599999
312.01398E+141599999
324.4113E+141599999
332.14276E+141499999
345.46002E+1415
ALADD 7
Cell Formulas
RangeFormula
A6,J20,L20,J14,L14,E11,C10,G10,K6,G6A6=FORMULATEXT(A7)
A7:A1000006A7=RANDARRAY(1000000,,1,999999999999999,1)
G7G7=ALADD(A7#)
K7K7=I_ALA(A7#)
C11:C1000010C11=LEN(A7#)
G11G11=LEN(G7)
E12E12=AVERAGE(C11#)
J15J15=ALADD(H15:H16)
L15L15=I_ALA(H15:H16)
J21J21=ALADD(H21:H33)
L21L21=I_ALA(H21:H33)
Dynamic array formulas.
 
Chapter 1. ADDition. Part 5. Examples, numbers as strings.
1M rows, 50 digits numbers.
Nr. iterations 3
LARGE NR OP.xlsx
ABCDEFGH
1Chapter 1. ADDition. Part 5. Examples, numbers as strings
2
3random array of numbers, 50 digits, 1M rows
4=BYROW(RANDARRAY(1000000,50,0,9,1),LAMBDA(x,CONCAT(x)))=ALADD(A5#)
51982174298616568047745831812729270172298714607809449988206234824628070602175557121321759633237928595662293
695348550315098019725363199589459633534969227347501
700627104782103391832984073464956749875534309676028nr. iterationsresult len
828911941188555640635450040775311475425235457158017=I_ALA(A5#)=LEN(C5)
986906816290060039038636001401935929483366617765519356
1094666968314339971675656000542728545957901426340368
1113380871283991771749147968054581593347843564880545rows check
1264477322276764662153686090675164610831275186383181=ROWS(A5#)
13649238781293293446809243921893260114982452037678171000000
1469413199382731927281292711250134892171524433232757
1562689997091355656367192864006272437701841509748826numbers len check
1688592749080021140142714432552863661120331570554027=AND(LEN(A5#)=50)
1743467642659113190252628006804183133967381187847541TRUE
1814560955019744129014940219541253064606160306925282
1945117477326386556947357971711532243415901064932036
2071254543056079355129497389136299207872480778332683
2133843742905297297728068163098183140984703119865601
2215663878016600355236226913285377862918431906302694
2348307670456976811146570850421359155679370529024146
2475510710250773875519128792820981083113366045185222
2566972319912190801914404484188762843806904138030052
2637654993480371823595664405498548178222461998669710
2763881648612567777678055240663685725659913080001911
2890459926509463409753073863960270321309323409166864
2980538566540881965762261191965055619464876471684823
3093665383666285704177596244982566197778907804967254
3187356468053599081960116099578853065305820309738859
3255327190655624216538648016546027342913057907262830
3345814101372067974657425504237026891278139328538285
3491789270070393441841335194345298908834703199531663
3543383416781900773514115184842659724980451437015339
3673928521791098336646413154313659083655156235123068
3748713395928297635588428770379619267765230523285436
3835991671627959637667121813721296526961332505492072
3941353886215085184869095145308314999580548707792007
4092364649557457749675807775860380961175753606652878
4122225129293651468795374977730744084437834004782152
4229949261245525433839604279709640538224943851879404
4354583402208403779154219261103535503943279981589798
4420199253826600868919040903951049904875350268984909
4561676927657781961566645589946156540201130925201155
4696186714291315817823007035161425744165590185729963
4758843706181380281107633728249629220585238170944241
4815929295892790348143365912155741920220425275776840
4965299801393525523135542109312829750780066291740236
5009199918120609031202708715663292212687069300222447
ALADD 8
Cell Formulas
RangeFormula
C4,C16,C12,E8,C8,A4C4=FORMULATEXT(C5)
A5:A1000004A5=BYROW(RANDARRAY(1000000,50,0,9,1),LAMBDA(x,CONCAT(x)))
C5C5=ALADD(A5#)
C9C9=I_ALA(A5#)
E9E9=LEN(C5)
C13C13=ROWS(A5#)
C17C17=AND(LEN(A5#)=50)
Dynamic array formulas.
 

Forum statistics

Threads
1,216,763
Messages
6,132,584
Members
449,737
Latest member
naes

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