# How to sum numbers that form an integer

#### RomulusMilea

##### Board Regular
Hello all,

Is there a possibility (a function, or a formula) to obtain sum of numbers that form a certain integer. I have a list with hundreds for integers. For example if my list contains integer 123456789, that formula should return 45. Thank you in advance.
Romulus.

### Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Assuming your integer is in cell A1, enter the following array formula in any other cell:

=SUM(VALUE(MID(A1,ROW(\$A\$1:OFFSET(\$A\$1,LEN(A1)-1,0)),1)))

Press Ctrl+Shift+Enter (not just Enter) after typing the formula.

On 2002-09-03 00:40, Andrew Poulsom wrote:
Assuming your integer is in cell A1, enter the following array formula in any other cell:

=SUM(VALUE(MID(A1,ROW(\$A\$1:OFFSET(\$A\$1,LEN(A1)-1,0)),1)))

Press Ctrl+Shift+Enter (not just Enter) after typing the formula.

just to expand a little, if may,

a non array entered way (Just enter) would be to use SUMPRODUCT:

=SUMPRODUCT(VALUE(MID(A1,ROW(\$A\$1:OFFSET(\$A\$1,LEN(A1)-1,0)),1)))

Also, it's important to note that if you needed this for a value in say A87 you need to keep the absolute references to A1 intact:

=SUMPRODUCT(VALUE(MID(A87,ROW(\$A\$1:OFFSET(\$A\$1,LEN(A87)-1,0)),1)))

Also:

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

A faster solution is also possible if the morefunc add-in is installed:

=SUMPRODUCT(MID(A1,INTVECTOR(LEN(A1),1,1,1),1)+0)

Morefunc is available at:

http://longre.free.fr/english/index.html

Replies
31
Views
2K
Replies
1
Views
400
Replies
5
Views
185
Replies
1
Views
142
Replies
6
Views
180

1,218,743
Messages
6,144,225
Members
450,531
Latest member
avril18

### 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?

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