View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Is there a formula for searching for any one of a list of strings?

??????????

=SUMPRODUCT(COUNTIF(A2:A20,{"apple","kumquat","pea r"}))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Lori" wrote in message
oups.com...
=COUNT(1/COUNTIF(A2:A20,{"apple","kumquat","pear"}))

Bob Phillips wrote:

=SUMPRODUCT(--(ISNUMBER(MATCH(A2:A20,{"apple","kumquat","pear"}, 0))))

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"bookgirl" wrote in message
...
I am making a template for a series of spreadsheets. I have a list of

strings
and a series of spreadsheets which contain varying numbers (or none)

of
that
list.

E.g. In a series of monthly spreadsheets of crates of fruit bought by

a
greengrocer, I want to search for particular types of fruit (apple,

kumquat
etc.) to see if he bought any that month.

I can make a formula (COUNTIF...) display if one of them appears, but

can't
find a way to count how many from my entire list appear (apple OR

kumquat
OR
lychee).

Please, can anybody help?