# 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,"")