Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default sum numbers which contains characters

in column A (A1:A11)
m
4A
8A
m
Tr
m
m
4A
4A
8A
8A

i would like to add up all the 4A and 8A so that my total column would
be 36A
how can i do that?
many thanks for any help
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default sum numbers which contains characters


You could try a user defined function used thus in a spreadsheet:
=SuffixSum(A1:A11,"A")
or
=SuffixSum(A1:A11,"B")

Function SuffixSum(TheRng, Suffix As String)
Dim SuffSum As Long
For Each cll In TheRng.Cells
mynumber = ""
For i = 1 To Len(cll)
OneChar = Mid(cll, i, 1)
If IsNumeric(OneChar) Then mynumber = mynumber & OneChar Else Exit
For
Next i
If OneChar = Suffix Then SuffSum = SuffSum + mynumber
Next cll
If SuffSum 0 Then SuffixSum = SuffSum & Suffix
End Function

NOTE:
Only integers are involved
It is case sensitive
Only one character can be used in the second argument
Only a number up to the first non-numeric character found in each cell
is considered.


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=125682

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,104
Default sum numbers which contains characters

If there will only be 4A and 8A (not 3A, 5A etc) then
=(COUNTIF(A1:A11,"4A")*4+COUNTIF(A1:A11,"8A")*8)&" A"
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"jacobs" wrote in message
...
in column A (A1:A11)
m
4A
8A
m
Tr
m
m
4A
4A
8A
8A

i would like to add up all the 4A and 8A so that my total column would
be 36A
how can i do that?
many thanks for any help



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
sum numbers which contain characters excelFan Excel Discussion (Misc queries) 5 July 31st 09 05:25 PM
Adding numbers or characters to existing numbers Jannie Excel Worksheet Functions 9 February 20th 07 03:08 PM
numbers to characters George Applegate Excel Worksheet Functions 1 July 22nd 06 03:37 PM
characters around numbers ellie Excel Discussion (Misc queries) 3 December 28th 05 09:14 PM
Converting characters to numbers Robbie aka Zoqaeski :p Excel Worksheet Functions 3 February 2nd 05 06:12 AM


All times are GMT +1. The time now is 08:13 AM.

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

About Us

"It's about Microsoft Excel"