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

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
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,403
Messages
6,119,309
Members
448,886
Latest member
GBCTeacher

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