venkat1926
595Posts
June 14, 2009Registration date
March 22, 2010Last seen
Aug 9, 2009 5:33am BST
supposse the entries are in A1 and B1 try this formula
=(LEN(A1)-LEN(SUBSTITUTE(A1,"333",""))+LEN(B1)-LEN(SUBSTITUTE(B1,"333","")))/LEN("333")
now if there are more cells then it would be ccumbrsome. in that case use a macro
the macro is like this
Sub test()
Dim j As Integer, rng As Range, c As Range
j = 0
Set rng = Range(Range("a1"), Range("a1").End(xlToRight))
For Each c In rng
j = j + UBound(Split(c, "333", , 1))
Next c
MsgBox j
End Sub
This was suggested recently by Peter_SSs an expert in one of the newsgroups