Sum of numbers of same cell and the result will be 0 to 9 or 11, 22, 33 or 44

Redfish

New Member
Joined
Jan 23, 2018
Messages
5
Hi,
I would like to know if you could help me create one formula to excel.
I would like to make a sum of each number of same cell.
The sum has to have the result of 0 to 9 or 11 or 22 or 33 or 44.
For example: If the cell has the number 911. The sum will be 9+1+1=11
For example if the number is 9996=9+9+9+6=33
For example if the numer is 23564=2+3+5+6+4=20=2+=2
In this moment I use this formula:
=If(REST(A1;9)=0;“9”;REST(A1;9)) (but the result will be from 0 to 9)
I need to add the exception if the result is 11 or 22 or 33 or 44
Can anyone help me?
I have the formula I can cover also the result of 11 but I need also to 22 or 33 or 44
=IF(A1=11;11;IF(REST(A1;9)=0;“9”;REST(A1;9)))
I have the same question in this link
https://www.excelguru.ca/forums/showthread.php?8749-Sum-of-numbers-of-same-cell-and-the-result-will-be-0-to-9-or-11-22-33-or-44
and in
https://www.excelforum.com/excel-fo...esult-will-be-0-to-9-or-11-22-33-or-44-a.html
Thanks.
Best regards
 
Then again, maybe three iterations is safer:


Book1
ABCD
1911111111
29996333333
3235642202
4279998444444
5222221101
699999369
7125638178
8777712810
Sheet1
Cell Formulas
RangeFormula
B1=IF(OR(D1<10,D1=11,D1=22,D1=33,D1=44),D1,SUMPRODUCT(1*MID(D1,ROW(INDIRECT("1:"&LEN(D1))),1)))
C1=SUMPRODUCT(1*MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))
D1=IF(OR(C1<10,C1=11,C1=22,C1=33,C1=44),C1,SUMPRODUCT(1*MID(C1,ROW(INDIRECT("1:"&LEN(C1))),1)))


WBD
 
Upvote 0

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
A little digging suggests that 3 is ample. Also, I'm wondering whether 11, 22, 33 and 44 are special cases and should just return those values (rather than 2, 4, 6 and 8) so here's my final proposal which would show OK if you hide columns B and C:


Book1
ABCD
1911111111
29996333333
3235642022
4279998444444
5222221011
699993699
719919101
8999999357123
9994222222
Sheet1
Cell Formulas
RangeFormula
B1=IF(OR(A1<10,A1=11,A1=22,A1=33,A1=44),A1,SUMPRODUCT(1*MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)))
C1=IF(OR(B1<10,B1=11,B1=22,B1=33,B1=44),B1,SUMPRODUCT(1*MID(B1,ROW(INDIRECT("1:"&LEN(B1))),1)))
D1=IF(OR(C1<10,C1=11,C1=22,C1=33,C1=44),C1,SUMPRODUCT(1*MID(C1,ROW(INDIRECT("1:"&LEN(C1))),1)))


WBD
 
Upvote 0
Perhaps with a single formula:
Code:
=IF(AND(MOD(SUM(--(0&MID(A1,{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16},1))),11)=0,(SUM(--(0&MID(A1,{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16},1)))<55)),SUM(--(0&MID(A1,{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16},1))),SUM(--(0&MID(SUM(--(0&MID(A1,{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16},1))),{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16},1))))
 
Upvote 0

Forum statistics

Threads
1,214,897
Messages
6,122,141
Members
449,066
Latest member
Andyg666

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