Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default countig of nonblank cells with speciffic condition

I am having the following situation:

A B
1 q 3
2 w 1
3 e
4 r 1
5 w 1
6 q 2
7 r 3
8 e
9 w 2
10 e 1
11 q
12 r 3
13 w 2
14 w
15 q 1

When used like array formula, SUM function
{=SUM((B:B)*(A:A="w"))} returns value 6

Following the logic, I tried the same aproach with COUNTA function,
but it does not work the same way

{=COUNTA((B:B)*(A:A="w"))} returns value 15 instead of value 4


I need to count number of nonblank cells in column B where "w" is respective
value in column A
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,104
Default countig of nonblank cells with speciffic condition

In any version of Excel, this non-array formula
=SUMPRODUCT(--(A1:A150="w"),--(B1:B150<""""))
In Excel 2007 only
=SUMPRODUCT(--(A:A="w"),--(B:B<""""))
or
=COUNTIFS(A:A,"w",B:B,"<""")
that is 3 double-quotes at the end


best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"Danko Jotanovic" wrote in
message ...
I am having the following situation:

A B
1 q 3
2 w 1
3 e
4 r 1
5 w 1
6 q 2
7 r 3
8 e
9 w 2
10 e 1
11 q
12 r 3
13 w 2
14 w
15 q 1

When used like array formula, SUM function
{=SUM((B:B)*(A:A="w"))} returns value 6

Following the logic, I tried the same aproach with COUNTA function,
but it does not work the same way

{=COUNTA((B:B)*(A:A="w"))} returns value 15 instead of value 4


I need to count number of nonblank cells in column B where "w" is
respective
value in column A



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default countig of nonblank cells with speciffic condition

Instead of using your first array, take a look at SUMIF/COUNTIF
=SUMIF(A:A,"w",B:B)

Since you have two conditions (nonblank, w in A:A) need to use SUMPRODUCT
=SUMPRODUCT(--(A2:A200="w"),--(NOT(ISBLANK(B2:B200))))

Note that you can't callout entire columns (A:A) using SUMPRODUCT, unless
using XL 2007.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Danko Jotanovic" wrote:

I am having the following situation:

A B
1 q 3
2 w 1
3 e
4 r 1
5 w 1
6 q 2
7 r 3
8 e
9 w 2
10 e 1
11 q
12 r 3
13 w 2
14 w
15 q 1

When used like array formula, SUM function
{=SUM((B:B)*(A:A="w"))} returns value 6

Following the logic, I tried the same aproach with COUNTA function,
but it does not work the same way

{=COUNTA((B:B)*(A:A="w"))} returns value 15 instead of value 4


I need to count number of nonblank cells in column B where "w" is respective
value in column A

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default countig of nonblank cells with speciffic condition

thanks to Bill Kuunders & Shane Devenshire in their reply to Studebaker I
have the result i needed:

=SUMPRODUCT((B:B<"")*(A:A="w"))

well done mates



"Danko Jotanovic" wrote:

I am having the following situation:

A B
1 q 3
2 w 1
3 e
4 r 1
5 w 1
6 q 2
7 r 3
8 e
9 w 2
10 e 1
11 q
12 r 3
13 w 2
14 w
15 q 1

When used like array formula, SUM function
{=SUM((B:B)*(A:A="w"))} returns value 6

Following the logic, I tried the same aproach with COUNTA function,
but it does not work the same way

{=COUNTA((B:B)*(A:A="w"))} returns value 15 instead of value 4


I need to count number of nonblank cells in column B where "w" is respective
value in column A

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
If statements looking for nonblank cells Mok721 Excel Worksheet Functions 1 July 14th 08 07:43 PM
Adding only NONBLANK cells Troubled Excel Discussion (Misc queries) 2 October 13th 07 04:39 PM
tally of nonblank cells AustinMom Excel Worksheet Functions 3 August 31st 06 09:00 PM
counting nonblank cells sbrimley Excel Worksheet Functions 7 May 18th 05 10:22 AM
Adding NonBlank Cells Emily8 Excel Worksheet Functions 3 January 4th 05 06:16 PM


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