Sum contents of a cell

davez

Board Regular
Joined
Feb 12, 2003
Messages
144
Office Version
  1. 365
Platform
  1. Windows
Hoping someone can help with this - I have varying values of differing lengths in individual cells that I need to sum eg -

A1 contains the value 198262456. I need to sum each number in that cell for a total of 43. I have been using the Mid function - =MID(A1,1,1)+MID(A1,2,1)+MID(A1,3,1)+ etc etc but the problem that I run into is that the cell character lengths can vary between 8 to 20, & I get #Value! errors when the MID formulas exceed the characters.

Any solutions?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
It would help if you included the version of Excel that you are using in your profile. Anyway, assuming you will not be inserting rows at the beginning of your worksheet, try this...

=SUM(0+(0&MID(A1,ROW(1:20),1)))

and if it doesn't work, then try this instead...

=SUMPRODUCT(0+(0&MID(A1,ROW(1:20),1)))
 
Last edited:
Upvote 0
Solution
It would help if you included the version of Excel that you are using in your profile. Anyway, assuming you will not be inserting rows at the beginning of your worksheet, try this...

=SUM(0+(0&MID(A1,ROW(1:20),1)))

and if it doesn't work, then try this instead...

=SUMPRODUCT(0+(0&MID(A1,ROW(1:20),1)))

Many thanks, the first suggestion works. My profile updated as well.
 
Upvote 0
Many thanks, the first suggestion works. My profile updated as well.
Actually, I had assumed you were not using xl365. Since you are, use this instead (and you can insert rows all you like)...

=SUM(0+MID(A1,SEQUENCE(LEN(A1)),1))
 
Upvote 0

Forum statistics

Threads
1,215,110
Messages
6,123,140
Members
449,098
Latest member
Doanvanhieu

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