Re: How can I sum a range that some cells have text and numb
How can I sum all the values in a range of cells where the cells contain either a number or text and a number. Please note the following example?
C17=9
D17=4
E17=8TD
F17=3TP
G17=7
I want the total of 31 but excel will ignore the cells with text.
Can you help me please?
Thanks
Hi TomA,
Type this codes to Module1:
Code:
Function Split_Digits(CeL)
Dim i As Integer
For i = 1 To Len(CeL)
DiGiT = Mid(CeL, i, 1)
If IsNumeric(DiGiT) = True Then
Split_Digits = Split_Digits & DiGiT
Split_Digits = Split_Digits * 1
End If
Next i
End Function
Then;
C18 and slide to right the formula to G18
And for example to C19:
Example table:
<table border=1><tr><td bgcolor=#CCCCFF align=left valign=center><font size=1 color=blue face=Tahoma>
Excel Sürümü:</font><font color=#660066 size=1 face=Tahoma> Excel 2003 ..ı|ı.. </font><font size=1 color=blue face=Tahoma>
İşletim Sistemi:</font><font size=1 color=#660066 face=Tahoma> XP Pro</font></td></tr><tr valign=top><td><table border=0 bgcolor=Black cellspacing=1 cellpadding=1 align=center><tr align=center valign=center bgcolor=white><td bgcolor=Black align=center><font color=white size=2></font></td><td bgcolor=Black width=60><font color=red size=1 face=Tahoma>C</font></td><td bgcolor=Black width=60><font color=red size=1 face=Tahoma>D</font></td><td bgcolor=Black width=60><font color=red size=1 face=Tahoma>E</font></td><td bgcolor=Black width=60><font color=red size=1 face=Tahoma>F</font></td><td bgcolor=Black width=60><font color=red size=1 face=Tahoma>G</font></td></tr><tr align=left bgcolor=white height=20><td align=center valign=center bgcolor=Black width=10><font color=red size=1 face=Tahoma>17</font></td><td bgcolor=white nowrap=true align=right><font size=1 color=gray face=Tahoma>9</font></td><td bgcolor=white nowrap=true align=right><font size=1 color=gray face=Tahoma>4</font></td><td bgcolor=white nowrap=true><font size=1 color=gray face=Tahoma>8TD</font></td><td bgcolor=white nowrap=true><font size=1 color=gray face=Tahoma>3TP</font></td><td bgcolor=white nowrap=true align=right><font size=1 color=gray face=Tahoma>7</font></td></tr><tr align=left bgcolor=white height=20><td align=center valign=center bgcolor=Black width=10><font color=red size=1 face=Tahoma>18</font></td><td bgcolor=white nowrap=true align=center><font size=1 color=gray face=Tahoma><ACRONYM title='=Split_Digits(C17)'>9
(ƒx)</ACRONYM></font></td><td bgcolor=white nowrap=true align=center><font size=1 color=gray face=Tahoma><ACRONYM title='=Split_Digits(D17)'>4
(ƒx)</ACRONYM></font></td><td bgcolor=white nowrap=true align=center><font size=1 color=gray face=Tahoma><ACRONYM title='=Split_Digits(E17)'>8
(ƒx)</ACRONYM></font></td><td bgcolor=white nowrap=true align=center><font size=1 color=gray face=Tahoma><ACRONYM title='=Split_Digits(F17)'>3
(ƒx)</ACRONYM></font></td><td bgcolor=white nowrap=true align=center><font size=1 color=gray face=Tahoma><ACRONYM title='=Split_Digits(G17)'>7
(ƒx)</ACRONYM></font></td></tr><tr align=left bgcolor=white height=20><td align=center valign=center bgcolor=Black width=10><font color=red size=1 face=Tahoma>19</font></td><td bgcolor=white nowrap=true align=center><font size=1 color=gray face=Tahoma><ACRONYM title='=SUM(C18:G18)'>31
(ƒx)</ACRONYM></font></td><td bgcolor=white></td><td bgcolor=white></td><td bgcolor=white></td><td bgcolor=white></td></tr></table></td></tr><tr><td bgcolor=yellow align=center><font color=blue size=1 face=Tahoma>
Excel'den HTML'ye (Artvin_V2 Sürümü) ..ı|ı.. ExcelTürkiye - 19 Aralık 2006©</font></td></tr></table>