What is the Excel formula to countif text partially makes up a cell

0 votes
Essentially, I am having trouble finding the formula to perform a countif in an array for text that partially comprises other cells in the array.

As an example, when searching for text "fire" in an array of "fire", "arcade fire", "firetruck", and "water", I'd want the formula to return a value of three. Have tried using countif and match to no avail.

Code I've tried includes: MATCH("FIRE",B1:B4,1) where B1:B4 are the above strings. COUNTIF("FIRE",B1:B4). =IF(ISNUMBER(SEARCH("FIRE",B1:B4)),1,0) (this function is not ideal as it would not be counting).
Mar 28, 2022 in Database by Edureka
• 13,670 points
13,174 views

1 answer to this question.

0 votes

With Formulas, Countif Partial String/Substring Match
We can use the COUNTIF function in Excel to count cells by placing an asterisk before and after a partial string or substring.

Select a blank cell to store the counting result, write the formula =COUNTIF(A1:A16,"*Anne*") into it, and press the Enter key (A1:A16 is the range to count cells, and Anne is the partial string).

The total number of cells containing the partial string is then calculated. Take a look at this example: