0

I have a column with many words in each cell. I want to count how many times a word is in the column and use:

=COUNTIF(Data!C3:C9,"*word*")

It works fine, now I want to reference a cell instead put the word. I am trying this, but it doesn't work:

=COUNTIF(Data!C3:C9,"*"+A3+"*")

How can I use the cell variable inside the criterion?

pnuts
  • 58,317
  • 11
  • 87
  • 139
coyr
  • 659
  • 6
  • 9

1 Answers1

1

In Google Spreadsheet, to concatenate two or more strings use ampersand, that is: "&" Try the following formula:

=COUNTIF(Data!C3:C9,"*"&A3&"*")

Or you can alternatively try:

=COUNTIF(Data!C3:C9,CONCATENATE("*",A3,"*"))
Kishan
  • 1,630
  • 13
  • 19