Looking for partial text inside another text across 4 columns in excel

I have text in columns A and B that I want to compare to text that I have in G and H. Column B contains only partial text, while column H contains the text I'm looking for. Columns A and G are the category - so I'm only interested in the text if the values of A and G are the same (i.e. if the category is the same).

Example:

E2 should then equal: "fun in amsterdam"

Answers


If the partial match has to be CaSe SeNsItIvE, use this:

=IF(AND(A1=G1,ISNUMBER(FIND(B1,H1))),"Found","Not Found")

If the partial match doesn't need to be case sensitive, so "xyz" is in "XYZ123", use this:

=IF(AND(A1=G1,ISNUMBER(SEARCH(B1,H1))),"Found","Not Found")

(The case-sensitivity tip came from @simoco !)

And if you want to return the case-sensitive value of H1, use this:

=IF(AND(A1=G1,ISNUMBER(FIND(B1,H1))),H1,"")

Need Your Help

C# find exact-match in string

c# string find exact-match

How can I search for an exact match in a string? For example, If I had a string with this text:

Unix - Shared Libraries Error

unix shared-libraries

When I type tmadmin -v I get this error:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.