Ok.. Check this UDF function...
Function Count_chars(rRange As Range, sstr As String) As Single
Dim i As Variant
Dim m As Variant
m = rRange.Value
Do
i = InStr(m, sstr & sstr)
m = Replace(m, sstr & sstr, sstr)
Loop Until i = 0
Count_chars = Len(Mid(m, 2, Len(m) - 2)) - Len(Replace(Mid(m, 2, Len(m) - 2), sstr, "")) + 1
End Function
Use it as =Count_chars(C1, ",") (or other character you want to test with...
It will consider space as character...sO
2,3,,, ,4 will return 4 (2 3 space 4) and 2,3,,,,4 will return 3 (2 3 4).
is that OK?
Bookmarks