#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PAL PAL is offline
external usenet poster
 
Posts: 200
Default COUNTIF

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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default COUNTIF

Look at this:
http://www.lqnet.com/Excel/sumproduct.aspx

Pay attention to these examples:
=SUMPRODUCT((A2:A5="Chicago")*(B2:B5="ABC")*(C2:C5 ))
=SUMPRODUCT((A2:A5="Chicago")*(B2:B5="ABC")*(C2:C5 ="Jan:), (D2:D5), (E2:E5))

Here's a video with a few more examples:
http://www.youtube.com/watch?v=O2ulQwMmlmY

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"PAL" wrote:

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.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PAL PAL is offline
external usenet poster
 
Posts: 200
Default COUNTIF

Not really sure how these would help if there is multiple values in the cell.

"ryguy7272" wrote:

Look at this:
http://www.lqnet.com/Excel/sumproduct.aspx

Pay attention to these examples:
=SUMPRODUCT((A2:A5="Chicago")*(B2:B5="ABC")*(C2:C5 ))
=SUMPRODUCT((A2:A5="Chicago")*(B2:B5="ABC")*(C2:C5 ="Jan:), (D2:D5), (E2:E5))

Here's a video with a few more examples:
http://www.youtube.com/watch?v=O2ulQwMmlmY

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"PAL" wrote:

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.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default COUNTIF

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.

--
Biff
Microsoft Excel MVP


"PAL" wrote in message
...
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.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default COUNTIF

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

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"T. Valko" wrote:

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.

--
Biff
Microsoft Excel MVP


"PAL" wrote in message
...
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.



.

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
Countif PK Excel Discussion (Misc queries) 2 November 17th 07 05:49 PM
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Excel Discussion (Misc queries) 2 September 25th 05 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM


All times are GMT +1. The time now is 08:44 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"