Help with excel formula

[Closed]
Report
-
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
-
Hello,

I have to count the number of times the word "work" appears in column A. Column A is a full sentence column with the word "work" appearing only once in the sentence. Also, I just want to count the word when the acronym TPI appears in column F. Any help is greatly appreciated.

1 reply

Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
802
try this macro (modify to suit you)

Sub test()
Dim j As Integer, r As Range, c As Range
Worksheets("sheet1").Activate
Set r = Range(Range("A1"), Range("A1").End(xlDown))
j = 0
For Each c In r
If InStr(1, c, "work", 1) > 0 Then j = j + 1
Next c
MsgBox "the number of times the word work appears is " & " " & j
End Sub