how can I search a field for a particular word

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a large document where in column C contains a sentence. I need a
formula that will look in Column C, identify the word "USDA" and populate a
new column with a 1. Can anyone help me with this?
 
Assume data in C2 down

If it's to be case sensitive,

Put in say, D2:
= IF(ISNUMBER(FIND("USDA",C2)),1,"")
Copy D2 down as far as required

Replace FIND with SEARCH if it's to be case insensitive
 
that worked. Now not to complicate it, but can I also search for two words in
the same cell but not in any order, just "USDA" and "GRADE" anywhere in the
sentence?
 
Think we could try instead in D2:

= IF(AND(ISNUMBER(FIND("USDA",C2)),ISNUMBER(FIND("GRADE",C2))),1,"")
 
You can use the same syntax for an OR situation:

=IF(OR(ISNUMBER(SEARCH({"USDA","GRADE"},C1))),1,"")

Biff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top