Is there any Excel Formula for comparing 2 columns for containing data and counting their occurrence?

时间秒杀一切 提交于 2021-02-08 11:16:53

问题


Hello everybody.
I ran into some problems when comparing data in columns in Excel / G-Sheets.
I tried to compare 2 columns with company names using the standard formula "=countif (A:A, B2)", where column "A" containing the names of the companies I am looking for (acceptable) and column "B" containing the names of companies that should match with company names in column "A".
For example, in column "A" there is a cell with the name of the company "Apple", and if in column "B" there is no cell with "Apple", it should return "0", but if on the contrary, it should return "1", "2", etc. But the problem is if a cell with “Apple Inc.” appears in column "B" it will return “0”, although this is the same company. Therefore, I am trying to find a formula where I can count cells not with an exact match, but if it even contains part of the value.
For example, if in column A we have a cell with value "Apple", if in column B we have "Apple Inc.", "GTX Apple", "The Apple" values formula must return "3".
I found some using "*" sign in countif formula, but it does not work as I want. Can someone help me with this issue?


回答1:


Consider:

=COUNTIF(B:B,"*" & A2 & "*")



来源:https://stackoverflow.com/questions/62174218/is-there-any-excel-formula-for-comparing-2-columns-for-containing-data-and-count

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