To test the number of times a string occurs within a single cell, you can use the following function:
Function CountString(rngWorklog As Range, _
strSearchText As String) As Integer
Dim strWorklog As String
Dim intSubtract As Integer
Dim intFound As Integer
Dim intCount As Integer
strWorklog = Range(rngWorklog.Address).Value
intSubtract = Len(strSearchText)
Do Until InStr(1, strWorklog, strSearchText) = 0
intFound = InStr(1, strWorklog, strSearchText)
strWorklog = Mid(strWorklog, intFound + intSubtract)
intCount = intCount + 1
Loop
CountString = intCount
End Function
To use this function within your worksheet, use the following formula:
=CountString(A1,"test"
