Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Summing up digits in a cell

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 127
Default Summing up digits in a cell

If you only have 2 digits, try this

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


"Sai Krishna" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Summing up digits in a cell

Thanks gaurav, this has helped for two digits.
regards
krishna

"Gaurav" wrote:

If you only have 2 digits, try this

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


"Sai Krishna" wrote in message
...
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




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 947
Default Summing up digits in a cell

... this has helped for two digits.

Another option for 1-2 digit numbers ...

=A1-9*INT(A1/10)

--
Dana DeLouis


"Sai Krishna" wrote in message ...

Thanks gaurav, this has helped for two digits.
regards
krishna

"Gaurav" wrote:


If you only have 2 digits, try this

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


"Sai Krishna" wrote in message
...

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



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Summing up digits in a cell

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
--
Gary''s Student - gsnu200787


"Sai Krishna" wrote:

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



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Summing up digits in a cell

=SUMPRODUCT(--MID(A4,ROW($A$1:INDEX($A:$A,LEN(A4),1)),1))
--
Wag more, bark less


"Sai Krishna" wrote:

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

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Summing up digits in a cell


Thanks a ton Brad. Was looking for something as useful and simple as this.
regards
krishna



"Brad" wrote:

=SUMPRODUCT(--MID(A4,ROW($A$1:INDEX($A:$A,LEN(A4),1)),1))
--
Wag more, bark less


"Sai Krishna" wrote:

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

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 846
Default Summing up digits in a cell

You're welcome
--
Wag more, bark less


"Sai Krishna" wrote:


Thanks a ton Brad. Was looking for something as useful and simple as this.
regards
krishna



"Brad" wrote:

=SUMPRODUCT(--MID(A4,ROW($A$1:INDEX($A:$A,LEN(A4),1)),1))
--
Wag more, bark less


"Sai Krishna" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove all but the last seven digits in a cell Gary Crisp Excel Discussion (Misc queries) 10 February 12th 08 07:59 PM
How to customize number to 10 digits including 2 digits after deci Carina Excel Worksheet Functions 3 September 20th 07 02:50 AM
Type 3 digits in one cell then automatically move to next cell. mulligbo Excel Discussion (Misc queries) 4 October 27th 06 11:51 PM
19 Digits in a Cell bri Excel Discussion (Misc queries) 1 November 30th 05 07:43 PM
12 or more digits in a cell scharlene New Users to Excel 4 August 30th 05 11:47 PM


All times are GMT +1. The time now is 11:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"