Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 921
Default 'COUNTIF' and 'AND"

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

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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 751
Default 'COUNTIF' and 'AND"

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 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



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default 'COUNTIF' and 'AND"

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
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" and "and" condition laingram Excel Worksheet Functions 2 June 28th 07 03:34 PM
Using "Countif" in macro gives compile error ashish128 Excel Discussion (Misc queries) 4 June 15th 07 12:23 PM
I need help with a formula similar to "countif" but more complex Hendrik Excel Worksheet Functions 1 June 22nd 06 09:25 AM
Logic of this formula =SUMPRODUCT((A1:A4<"")/COUNTIF(A1:A4,A1:A4& vishu Excel Discussion (Misc queries) 3 March 28th 06 08:56 AM
=countif (h3:h16"=01 01 2006") how to substitute cell for date Barry Excel Worksheet Functions 4 January 14th 06 12:35 AM


All times are GMT +1. The time now is 12:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"