Dominic
Dominic

Reputation: 164

Excel - If cell contains specific text

Looking for a function that will search the row it's in and see if it contains a specific String. Example excel spreadsheet:

Column E        Column G
NOT FOUND       G = Column A
FOUND           <leave blank>
FOUND           <leave blank>
null            G = Column A

I've tried:

=IF(ISTEXT(SEARCH({"NOT FOUND","null"},E2)),G2=E2,"")

Upvotes: 0

Views: 1314

Answers (2)

Scott Craner
Scott Craner

Reputation: 152450

I will assume you are not trying to find the exact match of the entire contents of the cells in Column E. If you are then @Abe's formula is the best.

If you are trying to search for those words in a longer string then:

=IF(SUMPRODUCT(1*(ISNUMBER(SEARCH({"NOT FOUND","null"},E2)))),A2,"")

enter image description here

Upvotes: 3

Abe Gold
Abe Gold

Reputation: 2347

=IF(OR(E2="NOT FOUND",E2="null"),A2,"")

Upvotes: 3

Related Questions