Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sum numbers which contain characters | Excel Discussion (Misc queries) | |||
Adding numbers or characters to existing numbers | Excel Worksheet Functions | |||
numbers to characters | Excel Worksheet Functions | |||
characters around numbers | Excel Discussion (Misc queries) | |||
Converting characters to numbers | Excel Worksheet Functions |