PC Review


Reply
Thread Tools Rate Thread

'COUNTIF' and 'AND"

 
 
=?Utf-8?B?SmVmZg==?=
Guest
Posts: n/a
 
      6th Jul 2007
I have two columns of data
I want a total count (not sum) of the first column only if the corresponding
second column is not blank
--
Thanks
 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrZSBI?=
Guest
Posts: n/a
 
      6th Jul 2007
Try:-

=SUMPRODUCT((A1:A5<>"")*(B1:B5=""))

Extend A5 - B5 as required

Mike

"Jeff" wrote:

> I have two columns of data
> I want a total count (not sum) of the first column only if the corresponding
> second column is not blank
> --
> Thanks

 
Reply With Quote
 
vezerid
Guest
Posts: n/a
 
      6th Jul 2007
The way you put it, you basically only want to count the non-blank
cells of 2nd col. If so, a generic solution involving SUMPRODUCT (and
not using one of the COUNTx functions):

=SUMPRODUCT(--(B1:B10<>""))

If you want a COUNTIF on A:A (e.g. all the 5's where B:B is not blank,

=SUMPRODUCT((A1:A10=5)*(B1:B10<>""))

Note: the -- in the first formula is to convert the TRUE/FALSE that
the expression produces into 1/0 so that they can be summed (logical
values are ignored by aggregate functions). In the second case
multiplication does the conversion thus the -- is not needed.

HTH
Kostis Vezerides



HTH
On Jul 6, 5:50 pm, Jeff <J...@discussions.microsoft.com> wrote:
> I have two columns of data
> I want a total count (not sum) of the first column only if the corresponding
> second column is not blank
> --
> Thanks



 
Reply With Quote
 
=?Utf-8?B?Ymo=?=
Guest
Posts: n/a
 
      6th Jul 2007
I think
=SUMPRODUCT((A1:A5<>"")*(B1:B5<>""))
Jeff wanted second column to not be blank
"Mike H" wrote:

> Try:-
>
> =SUMPRODUCT((A1:A5<>"")*(B1:B5=""))
>
> Extend A5 - B5 as required
>
> Mike
>
> "Jeff" wrote:
>
> > I have two columns of data
> > I want a total count (not sum) of the first column only if the corresponding
> > second column is not blank
> > --
> > Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difficulty "countif"-ing number of "L1" or "L2" on an autofiltered pmdoherty Microsoft Excel Worksheet Functions 4 6th Feb 2009 11:23 AM
IF(COUNTIF(Thursday,"John Doe")>1,"error"," ") jayd77 Microsoft Excel Discussion 2 27th Oct 2005 02:17 AM
Re: IF(COUNTIF(Thursday,"John Doe")>1,"error"," ") jayd77 Microsoft Excel Discussion 0 27th Oct 2005 12:48 AM
Countif(a2:a10, "apples""pears""oranges") =?Utf-8?B?QWRhbQ==?= Microsoft Excel Misc 5 3rd Nov 2004 06:37 AM
Re: "SUMIF" or "COUNTIF" to count alpha characters as .5 ? Angela Microsoft Excel Discussion 1 18th Sep 2004 01:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:58 AM.