1

I'm trying to build a formula that performs a COUNTIF on one column of text entries (call it Col B), with the criteria being the text of an adjacent column (say ColA). The formula with wildcards works perfectly if I write the criteria out in the formula itself, but returns a count of 0 when the criteria text is housed in a separate column (A).

Here's what the current formula I have looks like that works:

=COUNTIF(B1:B150, "*" & "Text Text" & "*")

And here's what I need it to be:

=COUNTIF(J1:J150, B1)

This old answer lists solutions to the text with wildcards but doesn't really cover the solution to having that text in another cell:

Google Spreadsheet, Count IF contains a string

Does anyone have thoughts on a solution? It'd be a lifesaver. Thanks!

thecyclist
  • 65
  • 2
  • 6

1 Answers1

1

Concatenate cell with wildcards:

=COUNTIF(J1:J150, "*" & B1 & "*")

or use your formula and enter wildcards directly in cell:

enter image description here

basic
  • 11,673
  • 2
  • 9
  • 26
  • Thanks so much! This worked the entire time--my issue was a trailing space which meant things the contents of the J column appeared to, but didn't quite match the B column. A =TRIM() formula solved it though--appreciate the help! – thecyclist Nov 13 '20 at 23:16