View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default SUMPRODUCT and finding text within a cell

On Tue, 7 Oct 2008 05:10:01 -0700, tigger
wrote:

I wonder if someone can help me.

I am trying to count the number of times a particular word describing a
resource type occurs in an array, based on other criteria.

The basic SUMPRODUCT formula works fine, but only if the word is the only
word in the cell. I want to be able to count if the word occurs in the cell
at all.

The working formula is as follows:
=SUMPRODUCT(--(K15:K597210)*($G$15:$G$59721="Broker")*($I$15:$I $59721))

where K15:K59721 is a number of days, G15:G59721 is the array I wish to
search and I15:I59721 is the number of resources required.

What I want is to be able to find "Broker" if it occurs in any part of the
array, e.g. in a cell containing "Architect,Broker". However, when I wildcard
the word in the formula it returns 0.

Can anyone help?


Try:

=SUMPRODUCT(--(K15:K597210)*NOT(ISERR(SEARCH("broker",$G$15:$G$ 59721)))*($I$15:$I$59721))

Note that the SEARCH worksheet function is case insensitive. If you need case
sensitivity, use FIND.
--ron