If I understood the question correctly, here is a formula you can use. It will only work in excel 2007.
Main Topics
Browse All TopicsHi, I need to determine if several comma seperated entries in colum B exist in column A. For example:
ColumnA ColumnB
23423 12232, 314454, 42435
235565 25566, ,235432, 3234, 235666
2555 5345, 54534, 346777, 345345, 353454
What Excel formula would work for this need?
Thanks
Spanoird!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
If you want to determine if any of the values in comma separated cell B2 are found in column A, then you might try a formula like:
=IF(SUM(COUNTIF(B2,"*" & A$2:A$1000 & "*")),"Exists","")
This formula is the opposite of the previous formula, which searched many cells in column B for a given value in column A.
Brad
Hi Byundt,
thanks for your participation and I opologize for the delayed response back, I have attached a file that makes use of your second offered solution. From what I can see it seems to not capture the desired results. Could you review and let me know if I am missing someting.
I am require to perform qc validations on comma sperated data entered on column B to ensure it is found in column A.
Thanks
Spanoird
Not sure of the solution to the problem (hence I stopped commenting : ) but I do know a reason why this won't work, at least the way it is now:
=IF(SUM(COUNTIF(B2,"*" & A$2:A$1000 & "*")),"Exists","")
this is taking B2 as having the value you are looking for, however it can have multiple value in the one cell...
Thanks AndrewMan3d2k!
The formula look to be the best promising so far, I believe with a bit of tweaking we can get it thier. Smart move to take it to text format.
I checked the results of your new formula and found that 4 out of the 10 reported as not found "No" in the B columns were found when searched manually.
Thanks for sticking with me a bit longer. I am also hard at work in seeking a solution. Thanks a bunch man!
Carlos
I didn't like the slow speed of my formula. I therefore decided to write some VBA code to do the job.
The attached workbook contains a user-defined function in column D that checks whether each of the comma separated values in column B is present somewhere in column A using a formula like:
=Matcher(B2,A:A)
If you only need to find one of the comma separated values, then the formula (shown in column E) would be:
=Matcher(B2,A:A,",",FAL
It is worth noting that you have a mix of numbers, text and text that looks like numbers in column A. The text that looks like numbers is a big problem because you won't be finding a match for it. See cell A215 in the Sheet1 sorted worksheet, for example.
To convert text that looks like numbers into real numbers:
1) Copy a blank cell
2) Select the cells in column A
3) Open the Edit&Paste Special menu item and choose the option for Add
It is also worth noting that you made the calculation mode Manual. So if you make changes, you must hit F9 to force the recalculation.
Finally, because the searching is done using a user-defined function, you must enable macros. If you have Excel 2003 or earlier, you'll get a macro warning message when you open the workbook. In Excel 2007, you see a macro warning message above the first row of data. If you don't see the warning message, then you need to change your macro security to Medium (Excel 2003) or to Disable unsigned macros with warning in Excel 2007 (I'm not sure of the exact wording of the Excel 2007 message).
Brad
andreyman3d2k, your assistance with this problem produce a formula that did capture some of the entry errors, so I have awarded points to you. Do want to thank you for sticking it out! Your formula appears to be usable in other areas as well. Thank You!
Brad, your formula hit the mark I was able to identify key entry errors building my confidence in my data and business use. Your VBA code was the ticket! I always wanted to 'dabble' in VBA and with this need and your code I have learned to make use of VBA, Thanks a million!
Great work Guys! Till next time, have a good day!
Carlos
Brad,
what formula would be needed for the reverse qc check? To check if single entry in columnA exist in a comma seperated multy entry in colum B. For example:
ColumnA ColumnB
23423 12232, 314454, 42435
235565 25566, ,235432, 3234, 235666
2555 5345, 54534, 346777, 345345, 353454
Let me know if this warrants posting a new question all together or similar and would require a quick tweak.
Thank You!
Carlos
Carlos,
The reverse QC check is covered by the formula in http:/#25593818
To search many cells in column B for a value in column A, you might try a formula like:
=IF(SUM(COUNTIF(B$2:B$4000
This formula ignores any leading zeros in cell A2. It converts the value in cell A2 into text, and so doesn't care whether A2 is a number or text that looks like a number. The bit with the curly braces and SUM is to trap single values entered as numbers in column B.
Brad
Carlos,
I tested the formula using real values, then substituted in the cell references--forgetting that cell references can't appear inside the array constant. The following formula works in Excel 2003 exactly as posted.
=IF(COUNTIF(B$2:B$4000,A2)
Sorry about the inconvenience.
Brad
Business Accounts
Answer for Membership
by: andreyman3d2kPosted on 2009-10-16 at 13:33:57ID: 25593096
what version of excel are you using?