Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default COUNTIF with wildcards

I need to count all the cells on one column with "Green" in them, but only
when another column has cells in a range with a value starting with "CC". I
tried to use the following formula, thinking that wildcard characters would
work, but a value of zero is returned. However, if I state the full name of
the "CC" cell, it works. Anyone got any ideas please?

=SUMPRODUCT(--($O$43:$O$268="Green"),--($D$43:$D$268="CC_*"))
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default COUNTIF with wildcards

try
=SUMPRODUCT(--($O$43:$O$268="Green"),--(left($D$43:$D$268,2)="CC"))
"Kierano" wrote:

I need to count all the cells on one column with "Green" in them, but only
when another column has cells in a range with a value starting with "CC". I
tried to use the following formula, thinking that wildcard characters would
work, but a value of zero is returned. However, if I state the full name of
the "CC" cell, it works. Anyone got any ideas please?

=SUMPRODUCT(--($O$43:$O$268="Green"),--($D$43:$D$268="CC_*"))

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default COUNTIF with wildcards

Thanks BJ - that worked perfectly.

Sorry to be a pain, but my next problem is, if I wanted to pick up the
"Greens" when another column was populated with 1, how would I do this? I've
tried putting the one in quotes, also without, to no avail.

"bj" wrote:

try
=SUMPRODUCT(--($O$43:$O$268="Green"),--(left($D$43:$D$268,2)="CC"))
"Kierano" wrote:

I need to count all the cells on one column with "Green" in them, but only
when another column has cells in a range with a value starting with "CC". I
tried to use the following formula, thinking that wildcard characters would
work, but a value of zero is returned. However, if I state the full name of
the "CC" cell, it works. Anyone got any ideas please?

=SUMPRODUCT(--($O$43:$O$268="Green"),--($D$43:$D$268="CC_*"))

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default COUNTIF with wildcards

Just keep adding the conditions:

=SUMPRODUCT(--($O$43:$O$268="Green"),
--($L$43:$L$268=1),
--(left($D$43:$D$268,2)="CC"))



Kierano wrote:

Thanks BJ - that worked perfectly.

Sorry to be a pain, but my next problem is, if I wanted to pick up the
"Greens" when another column was populated with 1, how would I do this? I've
tried putting the one in quotes, also without, to no avail.

"bj" wrote:

try
=SUMPRODUCT(--($O$43:$O$268="Green"),--(left($D$43:$D$268,2)="CC"))
"Kierano" wrote:

I need to count all the cells on one column with "Green" in them, but only
when another column has cells in a range with a value starting with "CC". I
tried to use the following formula, thinking that wildcard characters would
work, but a value of zero is returned. However, if I state the full name of
the "CC" cell, it works. Anyone got any ideas please?

=SUMPRODUCT(--($O$43:$O$268="Green"),--($D$43:$D$268="CC_*"))


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default COUNTIF with wildcards

Thanks - I probably need to explain it better:

There are just 2 columns I'm interested in - the one with the "Greens" and
the one with the "1s" in.

The problem lies in picking up the 1s for some reason.



"Dave Peterson" wrote:

Just keep adding the conditions:

=SUMPRODUCT(--($O$43:$O$268="Green"),
--($L$43:$L$268=1),
--(left($D$43:$D$268,2)="CC"))



Kierano wrote:

Thanks BJ - that worked perfectly.

Sorry to be a pain, but my next problem is, if I wanted to pick up the
"Greens" when another column was populated with 1, how would I do this? I've
tried putting the one in quotes, also without, to no avail.

"bj" wrote:

try
=SUMPRODUCT(--($O$43:$O$268="Green"),--(left($D$43:$D$268,2)="CC"))
"Kierano" wrote:

I need to count all the cells on one column with "Green" in them, but only
when another column has cells in a range with a value starting with "CC". I
tried to use the following formula, thinking that wildcard characters would
work, but a value of zero is returned. However, if I state the full name of
the "CC" cell, it works. Anyone got any ideas please?

=SUMPRODUCT(--($O$43:$O$268="Green"),--($D$43:$D$268="CC_*"))


--

Dave Peterson

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
sumproduct vs. countif Coal Miner Excel Discussion (Misc queries) 1 June 15th 06 09:34 PM
Countif Formula /Sort Bug??? orcfodder Excel Discussion (Misc queries) 2 January 12th 06 10:04 AM
countif wildcards? Ltat42a Excel Discussion (Misc queries) 3 December 18th 05 04:59 PM
Combining IF and COUNTIF based on two columns maxtrixx Excel Discussion (Misc queries) 5 March 31st 05 06:21 PM
Countif - Countif maswinney Excel Worksheet Functions 3 November 15th 04 11:06 PM


All times are GMT +1. The time now is 07:38 AM.

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"