Formula in Excel to count occurrences of substrings within strings

前端 未结 2 1929
我寻月下人不归
我寻月下人不归 2021-01-03 19:36

I am trying to count the number of times a sub-string appears within a column of string data in Excel. Please see the below example.

The column of string data (tweet

2条回答
  •  半阙折子戏
    2021-01-03 20:28

    You are nearly there, use

    =COUNTIF(A:A, "*"&B1&"*")
    

    Caveat:
    This counts the number of cells in A:A that contain the string one or more times. It does not count the total number of instances of the string.

提交回复
热议问题