# How to check if any data in a column contains data from a cell?

Hi everyone,

I need a formula to find out if the text in each cell of a column is contained in any cell in another column. If it is, show "Yes" or "True". It is kind of confusing so I attached an excel document I whipped up as an example. As you can see in the below picture, I need excel to check if B2 text is contained in A2 through A5. Since A2 contained "100100" it marked it as a "Yes" is cell C2. I would like the ability to put the formula in C2 then drag it down to C3, C4, C5, etc and have it reference B3, B4, B5 cells while still searching A2 through A5 for each one. The formula that works is  >>>>  =IF(COUNTIF(A2:A6,"*100100*")=0,"No","Yes")  <<<<  but I have to go in and manually type the number I would like to search for instead of just referencing cell B2. I know this sounds confusing but any assistance is appreciated.

Thank you,

- Alex
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

IT Services ConsultantCommented:
Hi Alex,

=IF(COUNTIF(A\$2:A\$5,"*"&B2&"*")=0,"No","Yes")

Place this in cell [C2], then copy down column [C] as required.

Change A\$5 to A\$<number of last row> if the range of your data in column [A] (& [ B ]) goes beyond row 5.
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
Thank you very much fanpages! I knew I needed the wild card in there but couldn't figure out how to get it in while referencing the cell. Appreciate all your help and quick response.

- Alex
0
IT Services ConsultantCommented:
No problem at all, Alex.

Thanks for closing the question so promptly :)
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.