COUNTIF Function

L

Leon

Help! I'm trying to use countif similar to:

=COUNTIF(A2:A9,"*Smith*") However, I want the "SMITH" to
be a cell reference.

If Cell A10 has a cell value of "Smith" and individual
cells from range A2:A9 contains multiple names [Smith,
Jones] or [Johnson, Smith], then I want a COUNTIF
statement:
=COUNTIF(A2:A9,"*A10*").

Any ideas?
Right now, the work around is do hard-code the COUNTIF
statement with "Smith", but I want to be able to change
the value of "Smith" without having to update the COUNTIFs
everytime.

Thanks.
 
A

Alan Beban

Leon said:
Help! I'm trying to use countif similar to:

=COUNTIF(A2:A9,"*Smith*") However, I want the "SMITH" to
be a cell reference.

If Cell A10 has a cell value of "Smith" and individual
cells from range A2:A9 contains multiple names [Smith,
Jones] or [Johnson, Smith], then I want a COUNTIF
statement:
=COUNTIF(A2:A9,"*A10*").

Any ideas?
Right now, the work around is do hard-code the COUNTIF
statement with "Smith", but I want to be able to change
the value of "Smith" without having to update the COUNTIFs
everytime.

Thanks.
=COUNTIF(A2:A9,"="&"*"&A10&"*")

Alan Beban
 
J

JulieD

Hi Leon

glad its solved - thanks for the feedback.

Cheers
JulieD

Leon said:
Thanks Alan and Julie, that fixed my problem!
Leon
-----Original Message-----
Help! I'm trying to use countif similar to:

=COUNTIF(A2:A9,"*Smith*") However, I want the "SMITH" to
be a cell reference.

If Cell A10 has a cell value of "Smith" and individual
cells from range A2:A9 contains multiple names [Smith,
Jones] or [Johnson, Smith], then I want a COUNTIF
statement:
=COUNTIF(A2:A9,"*A10*").

Any ideas?
Right now, the work around is do hard-code the COUNTIF
statement with "Smith", but I want to be able to change
the value of "Smith" without having to update the COUNTIFs
everytime.

Thanks.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top