COUNTIF

P

PAL

I am using the COUNTIF function as follows.

=COUNTIF(Data!AN2:AN533,LOV!A2)

It works for the most part, however, the fields I am looking up
(Data!AN2:AN533) may have more than one value in it.

That is, if LOV!A2 is "Car", Data!AN2, may have "Car, Train,..." or "Train,
Car...).

Is there anyway to use Countif and a wild card value?

Thanks. Happy Holidays.
 
T

T. Valko

Try something like this...

=COUNTIF(Data!AN2:AN533,"*"&LOV!A2&"*")

Note that it's possible to get "false positives" using this method. Without
knowing what your data looks like it's hard to say if this will be an issue.
For example:

LOV!A2 = car

Data!AN2 = train, cart

This will be counted because the substring car is contained in cart.
 
R

ryguy7272

I amy have misunderstood. Try something like this:
=SUMPRODUCT(ISNUMBER(SEARCH("*car*",A1:A5))*((B1:B5)))
 

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