Pyramid sum of six digit in single cell

JAVEDR

Board Regular
Joined
Sep 17, 2019
Messages
79
Office Version
  1. 2019
Platform
  1. Windows
  2. Mobile
  3. Web
Respected members,

I have six digit number in column A and need pyramid result corresponding cell. For example below -

In A1 if record is 123123 then pyramid calculation result 4 need to be shown in B2

123123
4
468477
6
245112
9

Pyramid calculation below

123123
35435
8978
765
31
4
468477
4214
4635
098
97
6
245112
69623
5585
033
36
9

Thank you in advance for your precious time and feedback.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Thanks, you can generalise to accommodate lengths other than 6 digits:

=MOD(SUMPRODUCT((0+MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),COMBIN(LEN(A1)-1,ROW(INDIRECT("1:"&LEN(A1)))-1)),10)

And if you have Excel 365, there is a shorter/better formula.
 
Upvote 0
Thanks, you can generalise to accommodate lengths other than 6 digits:

=MOD(SUMPRODUCT((0+MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),COMBIN(LEN(A1)-1,ROW(INDIRECT("1:"&LEN(A1)))-1)),10)

And if you have Excel 365, there is a shorter/better formula.
just one more help can we create that pyramid as well like I shown above.
 
Upvote 0
AB
1468477468477
20421404214
346354635
4098098
59797
666
Sheet1
Cell Formulas
RangeFormula
A2:A6A2=RIGHT(REPT("0",LEN(A1)-1)& SUMPRODUCT(MOD(MMULT(0+MID(A1,{1,2}+ROW(INDIRECT("1:"&LEN(A1)-1))-1,1),{1;1}),10)*10^(LEN(A1)-1-ROW(INDIRECT("1:"&LEN(A1)-1)))),LEN(A1)-1)
B2:B6B2=TEXTJOIN(,,MOD(MMULT({1,1},0+MID(B1,{1;2}+SEQUENCE(,LEN(B1)-1,0),1)),10))


B2 formula is for Excel 365
 
Upvote 0
AB
1468477468477
20421404214
346354635
4098098
59797
666
Sheet1
Cell Formulas
RangeFormula
A2:A6A2=RIGHT(REPT("0",LEN(A1)-1)& SUMPRODUCT(MOD(MMULT(0+MID(A1,{1,2}+ROW(INDIRECT("1:"&LEN(A1)-1))-1,1),{1;1}),10)*10^(LEN(A1)-1-ROW(INDIRECT("1:"&LEN(A1)-1)))),LEN(A1)-1)
B2:B6B2=TEXTJOIN(,,MOD(MMULT({1,1},0+MID(B1,{1;2}+SEQUENCE(,LEN(B1)-1,0),1)),10))


B2 formula is for Excel 365
 
Upvote 0
Ex
AB
1468477468477
20421404214
346354635
4098098
59797
666
Sheet1
Cell Formulas
RangeFormula
A2:A6A2=RIGHT(REPT("0",LEN(A1)-1)& SUMPRODUCT(MOD(MMULT(0+MID(A1,{1,2}+ROW(INDIRECT("1:"&LEN(A1)-1))-1,1),{1;1}),10)*10^(LEN(A1)-1-ROW(INDIRECT("1:"&LEN(A1)-1)))),LEN(A1)-1)
B2:B6B2=TEXTJOIN(,,MOD(MMULT({1,1},0+MID(B1,{1;2}+SEQUENCE(,LEN(B1)-1,0),1)),10))


B2 formula is for Excel 365
excellent sir perfect what i was looking thanks for your quick revert
 
Upvote 0

Forum statistics

Threads
1,216,122
Messages
6,128,961
Members
449,480
Latest member
yesitisasport

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