Pyramid sum

Hans K

New Member
Joined
Oct 30, 2015
Messages
43
Office Version
  1. 365
Platform
  1. Windows
Any chance that StepenCrump or someone else would explain the formula:

=MOD(SUMPRODUCT((0+MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),COMBIN(LEN(A1)-1,ROW(INDIRECT("1:"&LEN(A1)))-1)),10)
(or a better one as I have Excel 365)

See below thread

 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try:

ABC
1623498
2
3Result9
4
5In detailSplitPascal
661
725
8310
9410
1095
1181
12
13139
14Result9
Sheet1
Cell Formulas
RangeFormula
B3B3=MOD(SUMPRODUCT((0+MID(A1,SEQUENCE(LEN(A1)),1)),COMBIN(LEN(A1)-1,SEQUENCE(LEN(A1),,0))),10)
B6:B11B6=0+MID(A1,SEQUENCE(LEN(A1)),1)
C6:C11C6=COMBIN(LEN(A1)-1,SEQUENCE(LEN(A1),,0))
B13B13=SUMPRODUCT(B6#,C6#)
B14B14=MOD(B13,10)
Dynamic array formulas.

The calculation is the SUMPRODUCT of
1. Each digit in the number, and
2. The number of ways each digit will be included in the sum, which is Pascal's triangle - draw each step of the pyramid and you'll see, for example, that there is only one path for the first digit, 6, and 10 paths for the middle digits, 3 and 4.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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