How to "countif" for cells that contain a similar value
I have a column with a list of Company Names in free text, and I would like to count all of the cells with the same name, though they may be typed slightly different. Such as, missing "Inc." or "Assoc.", etc.
I have a separate sheet with a column of the correct names. I would like to display the quantity next to this column. I use the COUNTIF formula and I return a number; however, it is not the correct total since some of the names vary slightly.
Answers
-
Hi
You can use a CONTAINS function to return the count for those that contain a certain string. How well this works will depend on your data and if you can identify the correct company based on part of the name without mis-identifying.
Here is how it would work.
If your free text looks like this:
Your lookup table would need to contain just enough to match, but not so much that you mis-match. Something like this:
You can then use a COUNTIF with CONTAINS like this
=COUNTIF([Company name (free text)]:[Company name (free text)], CONTAINS([Company name to look for]@row, @cell))
The part in bold could be a cross sheet reference.
You could hide the lookup column and instead have the full correct name displayed.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.1K Get Help
- 449 Global Discussions
- 155 Industry Talk
- 505 Announcements
- 5.4K Ideas & Feature Requests
- 85 Brandfolder
- 156 Just for fun
- 80 Community Job Board
- 514 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!