A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

search a row for a word and if found



 
 
Thread Tools Display Modes
  #1  
Old April 16th, 2010, 08:10 AM posted to microsoft.public.excel.worksheet.functions
Vibeke
external usenet poster
 
Posts: 41
Default search a row for a word and if found

I have 4 columns (C to F) I need to search row by row for a particular word.
If the word is found in a row, I need to return 1 in Column G or 0 if not
found. I've tried various iterations of IF\SEARCH\MATCH and so on. The four
columns contain address lines, i.e. a mixture of text and numbers and the
word can appear in any of the columns, at any place in the string. I'd prefer
if it weren't case sensitive but it's not imperative. Many thanks in
anticipation!
  #2  
Old April 16th, 2010, 08:22 AM posted to microsoft.public.excel.worksheet.functions
Jacob Skaria
external usenet poster
 
Posts: 5,952
Default search a row for a word and if found

Try the below

=IF(COUNTIF(C4:F4,"*findword*"),1,0)

'with the query word in cell A1
=IF(COUNTIF(C4:F4,"*" & A1 & "*"),1,0)

--
Jacob (MVP - Excel)


"Vibeke" wrote:

I have 4 columns (C to F) I need to search row by row for a particular word.
If the word is found in a row, I need to return 1 in Column G or 0 if not
found. I've tried various iterations of IF\SEARCH\MATCH and so on. The four
columns contain address lines, i.e. a mixture of text and numbers and the
word can appear in any of the columns, at any place in the string. I'd prefer
if it weren't case sensitive but it's not imperative. Many thanks in
anticipation!

  #3  
Old April 16th, 2010, 10:09 AM posted to microsoft.public.excel.worksheet.functions
Jarek Kujawa[_2_]
external usenet poster
 
Posts: 775
Default search a row for a word and if found

another way:
A1="word"

=IF(ISERROR(FIND(A1,C1&D1&E1&F1)),,1)

HIH

On 16 Kwi, 09:10, Vibeke wrote:
I have 4 columns (C to F) I need to search row by row for a particular word.
If the word is found in a row, I need to return 1 in Column G or 0 if not
found. I've tried various iterations of IF\SEARCH\MATCH and so on. The four
columns contain address lines, i.e. a mixture of text and numbers and the
word can appear in any of the columns, at any place in the string. I'd prefer
if it weren't case sensitive but it's not imperative. Many thanks in
anticipation!


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:53 PM.


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