Excel COUNTIF cell contains a given text (partial match)

安稳与你 提交于 2019-12-23 09:05:03

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/32441310/excel-countif-cell-contains-a-given-text-partial-match

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!