Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel COUNTIF cell contains a given text (partial match)

I have a conditional formatting with cells like

=COUNTIF(A3:H2663;R5)

If the value entered into R5 is found elsewhere, the box will then turn red.

However, sometimes it's not an exact match, and then it doesn't recognize it. That may be because of an extra figure at the end of the entered number.

So my question is: can I change the formula to make a match, if the cells from A3:H2663 simply contain the value in R5, and isn't an exact match?

like image 466
Thomas Avatar asked Sep 07 '15 14:09

Thomas


People also ask

How do I use Countif with partial string substring match in Excel?

Countif partial string/substring match with formulas Select a blank cell you will place the counting result at, type the formula =COUNTIF(A1:A16,"*Anne*") (A1:A16 is the range you will count cells, and Anne is the certain partial string) into it, and press the Enter key.

How do I Countif a cell contains text or part of text in Excel?

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).

How do I use Countif with specific text?

In the empty cell, type the following: “=COUNTIF (range, criteria).” This formula counts the number of cells in the specified range with text. For “range,” type in the cell range you want. Enter the first and last cells, divided by a colon. For example, to count cells B2 to B10, you'd type in the following: “ B2:B10 .”


1 Answers

With the COUNTIF() function, you can use wildcard characters in your criteria.

If you want to find any cell value that has the search/criteria value at the very start:

=COUNTIF(A3:H2663, R5 & "*")

If you want to find any cell value that has the search/criteria value anywhere in it:

=COUNTIF(A3:H2663, "*" & R5 & "*")

The * wildard character represents zero or more characters.

like image 55
Nerdwood Avatar answered Oct 09 '22 19:10

Nerdwood