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  

Function to seacrh for a word across multiple columns



 
 
Thread Tools Display Modes
  #1  
Old April 16th, 2010, 08:49 PM posted to microsoft.public.excel.worksheet.functions
Vibeke
external usenet poster
 
Posts: 41
Default Function to seacrh for a word across multiple columns

Hi, I have four columns of data (C-F) I need to search for a particular word.
The data is addresses, i.e. it combines text and numbers and the word I'm
searching for can appear anywhere within it (or not at all). The function I
require will return 1 if it does and 0 if it does not. Have tried various
iterations of if\search\match and so on to no avail - perhaps because I'm
searching a range of columns rather than a specific cell? I'd appreciate your
suggestions. Regards,
  #2  
Old April 16th, 2010, 09:16 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Function to seacrh for a word across multiple columns

Maybe something like this...

=COUNT(MATCH("*word*",C1:F1,0))

--
Biff
Microsoft Excel MVP


"Vibeke" wrote in message
...
Hi, I have four columns of data (C-F) I need to search for a particular
word.
The data is addresses, i.e. it combines text and numbers and the word I'm
searching for can appear anywhere within it (or not at all). The function
I
require will return 1 if it does and 0 if it does not. Have tried various
iterations of if\search\match and so on to no avail - perhaps because I'm
searching a range of columns rather than a specific cell? I'd appreciate
your
suggestions. Regards,



  #3  
Old April 19th, 2010, 09:01 AM posted to microsoft.public.excel.worksheet.functions
Steve Dunn
external usenet poster
 
Posts: 192
Default Function to seacrh for a word across multiple columns

or,

=--(countif(c1:f1,"*word*")0)

but there is a possible problem. If the word you are searching for appears
within another word. e.g. "forward" contains "for", "or", and "ward", so if
your cells contained "forward" and you were looking for one of those words,
they would be found even if they weren't actually there. A slight variation
would be:

=--(countif(c1:f1,"* word *")0)

but you would then have a situation where words at the beginning or end of a
string, or words with punctuation beside them, would not be found. So the
answer to this one could be quite a bit more complex than you would think,
is that why you have ignored the answers given to your earlier post?



"T. Valko" wrote in message
...
Maybe something like this...

=COUNT(MATCH("*word*",C1:F1,0))

--
Biff
Microsoft Excel MVP


"Vibeke" wrote in message
...
Hi, I have four columns of data (C-F) I need to search for a particular
word.
The data is addresses, i.e. it combines text and numbers and the word I'm
searching for can appear anywhere within it (or not at all). The function
I
require will return 1 if it does and 0 if it does not. Have tried various
iterations of if\search\match and so on to no avail - perhaps because I'm
searching a range of columns rather than a specific cell? I'd appreciate
your
suggestions. Regards,




 




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 10:45 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.