问题
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