Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
brantty
 
Posts: n/a
Default how can I search a field for a particular word

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?
  #2   Report Post  
Max
 
Posts: n/a
Default

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
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"brantty" wrote in message
...
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?



  #3   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Try this:

=IF(ISNUMBER(SEARCH("USDA",C1)),1,"")

Biff

"brantty" wrote in message
...
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?



  #4   Report Post  
brantty
 
Posts: n/a
Default

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?

"Max" wrote:

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
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"brantty" wrote in message
...
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?




  #5   Report Post  
Max
 
Posts: n/a
Default

Think we could try instead in D2:

= IF(AND(ISNUMBER(FIND("USDA",C2)),ISNUMBER(FIND("GR ADE",C2))),1,"")

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"brantty" wrote in message
...
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?





  #6   Report Post  
Biff
 
Posts: n/a
Default

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

Biff

"Max" wrote in message
...
Think we could try instead in D2:

= IF(AND(ISNUMBER(FIND("USDA",C2)),ISNUMBER(FIND("GR ADE",C2))),1,"")

--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"brantty" wrote in message
...
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?





  #7   Report Post  
Max
 
Posts: n/a
Default

Thanks for refinement, Biff !
Much neater ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Biff" wrote in message
...
=IF(AND(ISNUMBER(SEARCH({"USDA","GRADE"},C1))),1," ")

Biff



  #8   Report Post  
Biff
 
Posts: n/a
Default

You can use the same syntax for an OR situation:

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

Biff

"Max" wrote in message
...
Thanks for refinement, Biff !
Much neater ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Biff" wrote in message
...
=IF(AND(ISNUMBER(SEARCH({"USDA","GRADE"},C1))),1," ")

Biff





  #9   Report Post  
Max
 
Posts: n/a
Default

Thanks for the extended illustration, Biff !
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"Biff" wrote in message
...
You can use the same syntax for an OR situation:

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

Biff



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile/Analyze Word Form Field data from multiple forms? jgundel Excel Discussion (Misc queries) 3 July 14th 05 02:54 AM
Excel date field link to Word Earl Excel Discussion (Misc queries) 1 July 13th 05 11:20 PM
How to Search for word in the Entire Workbook lbbss Excel Discussion (Misc queries) 4 July 4th 05 08:57 PM
insert field from Word into Excel Kaththea Excel Worksheet Functions 6 June 8th 05 06:56 PM
Word field codes in Excel data file Includetext mranz Excel Discussion (Misc queries) 1 December 7th 04 11:19 PM


All times are GMT +1. The time now is 07:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"