Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / May 2008

Tip: Looking for answers? Try searching our database.

Summing up digits in a cell

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sai Krishna - 21 May 2008 13:30 GMT
Hi,

i need to add all the digits in a cell. For example, if I have a number 58
in a cell, the adjacent cell should return a value of 13.
regards
krishna
Gaurav - 21 May 2008 13:41 GMT
If you only have 2 digits, try this

=SUM(LEFT(A2,1),RIGHT(A2,1))

> Hi,
>
> i need to add all the digits in a cell. For example, if I have a number 58
> in a cell, the adjacent cell should return a value of 13.
> regards
> krishna
Sai Krishna - 22 May 2008 05:36 GMT
Thanks gaurav, this has helped for two digits.
regards
krishna

> If you only have 2 digits, try this
>
[quoted text clipped - 6 lines]
> > regards
> > krishna
Dana DeLouis - 23 May 2008 02:49 GMT
> ... this has helped for two digits.

Another option for 1-2 digit numbers ...

=A1-9*INT(A1/10)

Signature

Dana DeLouis

> Thanks gaurav, this has helped for two digits.
> regards
[quoted text clipped - 10 lines]
>> > regards
>> > krishna
Gary''s Student - 21 May 2008 13:45 GMT
Try this small UDF:

Function digicount(r As Range) As Integer
Dim n As Integer
digicount = 0
v = r.Value
L = Len(v)
For i = 1 To L
   n = Mid(v, i, 1)
   digicount = digicount + n
Next
End Function
Signature

Gary''s Student - gsnu200787

> Hi,
>
> i need to add all the digits in a cell. For example, if I have a number 58
> in a cell, the adjacent cell should return a value of 13.
> regards
> krishna
Brad - 21 May 2008 14:06 GMT
=SUMPRODUCT(--MID(A4,ROW($A$1:INDEX($A:$A,LEN(A4),1)),1))
Signature

Wag more, bark less

> Hi,
>
> i need to add all the digits in a cell. For example, if I have a number 58
> in a cell, the adjacent cell should return a value of 13.
> regards
> krishna
Sai Krishna - 22 May 2008 05:38 GMT
Thanks a ton Brad. Was looking for something as useful and simple as this.
regards
krishna

> =SUMPRODUCT(--MID(A4,ROW($A$1:INDEX($A:$A,LEN(A4),1)),1))
>
[quoted text clipped - 4 lines]
> > regards
> > krishna
Brad - 22 May 2008 13:46 GMT
You're welcome
Signature

Wag more, bark less

> Thanks a ton Brad. Was looking for something as useful and simple as this.
> regards
[quoted text clipped - 8 lines]
> > > regards
> > > krishna
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.