Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default String function

I have a long string of words in one cell. Is there a
function that I can use to search a range of cells and
count the cells that contain that specific phrase?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default String function

In Excel there is a function called Find and in VBA there is a function
called Instr. Take a look at those. Your question is a little unclear in that
you say that the string is in one cell but you want to know which cells
contain the phrase.

HTH

"jason" wrote:

I have a long string of words in one cell. Is there a
function that I can use to search a range of cells and
count the cells that contain that specific phrase?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default String function

Hi Jason,

jason wrote:
I have a long string of words in one cell. Is there a
function that I can use to search a range of cells and
count the cells that contain that specific phrase?


Are you looking for VBA code to do this, or just a worksheet function? If
the latter, you could try this array formula:

=SUM(IF(ISERR(SEARCH($A$1,$C$1:$C$4)),0,1))

This assumes the string to be looked for is in A1 and the range to be
searched is C1:C4. If you need a case-sensitive search, you can use FIND
instead of SEARCH.

This must be entered using Ctrl+Shift+Enter.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default String function

thanks jake. i'll give it a try.
-----Original Message-----
Hi Jason,

jason wrote:
I have a long string of words in one cell. Is there a
function that I can use to search a range of cells and
count the cells that contain that specific phrase?


Are you looking for VBA code to do this, or just a

worksheet function? If
the latter, you could try this array formula:

=SUM(IF(ISERR(SEARCH($A$1,$C$1:$C$4)),0,1))

This assumes the string to be looked for is in A1 and

the range to be
searched is C1:C4. If you need a case-sensitive search,

you can use FIND
instead of SEARCH.

This must be entered using Ctrl+Shift+Enter.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address

unmonitored]

.

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
Function to evaluate function as string Basil Excel Worksheet Functions 3 September 18th 09 10:43 AM
string function help Eelinla Excel Discussion (Misc queries) 5 April 21st 07 08:26 PM
Add Function to String Ronbo Excel Worksheet Functions 2 February 22nd 05 05:33 AM
String Function Brenda Excel Programming 5 February 4th 05 03:24 AM
String function Irina Excel Worksheet Functions 1 November 9th 04 06:18 PM


All times are GMT +1. The time now is 06:00 PM.

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"