#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 32
Default COUNTIF ?

My spreadsheet has 8 columns (A:H).
Column 'A' is populated with a year (2005 to 2010) - not sorted.
Cells in Columns 'B' thru' 'H' are either blanks or numbers.

I want to COUNT the number of non-blank cells in column 'B' where the
adjacent cell in column 'A' = 2005.

Is there a formula that will do this for me?

Many thanks for any replies,
Regards,
Dave Moore
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default COUNTIF ?


If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"DaveMoore" wrote in message
...
My spreadsheet has 8 columns (A:H).
Column 'A' is populated with a year (2005 to 2010) - not sorted.
Cells in Columns 'B' thru' 'H' are either blanks or numbers.

I want to COUNT the number of non-blank cells in column 'B' where the
adjacent cell in column 'A' = 2005.

Is there a formula that will do this for me?

Many thanks for any replies,
Regards,
Dave Moore


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

Try this...

=SUMPRODUCT(--(A2:A20=2005),--(B2:B20<""))

--
Biff
Microsoft Excel MVP


"DaveMoore" wrote in message
...
My spreadsheet has 8 columns (A:H).
Column 'A' is populated with a year (2005 to 2010) - not sorted.
Cells in Columns 'B' thru' 'H' are either blanks or numbers.

I want to COUNT the number of non-blank cells in column 'B' where the
adjacent cell in column 'A' = 2005.

Is there a formula that will do this for me?

Many thanks for any replies,
Regards,
Dave Moore



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

Hi,
In the cell where you want the total count enter

=SUMPRODUCT((A1:A12=2005)*B1:B12)

change range to fit your needs but remember the range has to be the same in
both side of the formula

"DaveMoore" wrote:

My spreadsheet has 8 columns (A:H).
Column 'A' is populated with a year (2005 to 2010) - not sorted.
Cells in Columns 'B' thru' 'H' are either blanks or numbers.

I want to COUNT the number of non-blank cells in column 'B' where the
adjacent cell in column 'A' = 2005.

Is there a formula that will do this for me?

Many thanks for any replies,
Regards,
Dave Moore
.

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

Oopps I missed something

=SUMPRODUCT((A1:A12=2005)*(B1:B12<""))

"Eduardo" wrote:

Hi,
In the cell where you want the total count enter

=SUMPRODUCT((A1:A12=2005)*B1:B12)

change range to fit your needs but remember the range has to be the same in
both side of the formula

"DaveMoore" wrote:

My spreadsheet has 8 columns (A:H).
Column 'A' is populated with a year (2005 to 2010) - not sorted.
Cells in Columns 'B' thru' 'H' are either blanks or numbers.

I want to COUNT the number of non-blank cells in column 'B' where the
adjacent cell in column 'A' = 2005.

Is there a formula that will do this for me?

Many thanks for any replies,
Regards,
Dave Moore
.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 32
Default COUNTIF ?

Thank you for this Biff, it works beautifully - but I don't understand
why?
Is there a webpage you can direct me to that will explain what these
(--) characters do in the formula?

Similarly, Eduardo's formula also worked. Thanks Eduardo but why does
this formula count the number of non-blank cells? I understand that
this part of the formula (A1:A12=2005) gives an answer of 1 which is
"TRUE" and is then multiplied by (B1:B12<"") - this is the part I do
not understand.
Can you help?


Many Thanks,
Dave Moore



On 15 Jan, 18:45, "T. Valko" wrote:
Try this...

=SUMPRODUCT(--(A2:A20=2005),--(B2:B20<""))

--
Biff
Microsoft Excel MVP

"DaveMoore" wrote in message

...



My spreadsheet has 8 columns (A:H).
Column 'A' is populated with a year (2005 to 2010) - not sorted.
Cells in Columns 'B' thru' 'H' are either blanks or numbers.


I want to COUNT the number of non-blank cells in column 'B' where the
adjacent cell in column 'A' = 2005.


Is there a formula that will do this for me?


Many thanks for any replies,
Regards,
Dave Moore- Hide quoted text -


- Show quoted text -


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

(B1:B12<"") - this is the part I do not understand.

< means not equal to (I think of it as meaning "is not")

"" means blank

So, put that together in plain English:

(B1:B12<"")

Check that the cells in the range B1:B12 "are not" blank. And the result is
an array of either TRUE or FALSE:

B1 "is not" blank = TRUE
B2 "is not" blank = FALSE
etc
etc
B12 "is not" blank = FALSE

See this for a comprehensive explanation on SUMPRODUCT:

http://xldynamic.com/source/xld.SUMPRODUCT.html

--
Biff
Microsoft Excel MVP


"DaveMoore" wrote in message
...
Thank you for this Biff, it works beautifully - but I don't understand
why?
Is there a webpage you can direct me to that will explain what these
(--) characters do in the formula?

Similarly, Eduardo's formula also worked. Thanks Eduardo but why does
this formula count the number of non-blank cells? I understand that
this part of the formula (A1:A12=2005) gives an answer of 1 which is
"TRUE" and is then multiplied by (B1:B12<"") - this is the part I do
not understand.
Can you help?


Many Thanks,
Dave Moore



On 15 Jan, 18:45, "T. Valko" wrote:
Try this...

=SUMPRODUCT(--(A2:A20=2005),--(B2:B20<""))

--
Biff
Microsoft Excel MVP

"DaveMoore" wrote in message

...



My spreadsheet has 8 columns (A:H).
Column 'A' is populated with a year (2005 to 2010) - not sorted.
Cells in Columns 'B' thru' 'H' are either blanks or numbers.


I want to COUNT the number of non-blank cells in column 'B' where the
adjacent cell in column 'A' = 2005.


Is there a formula that will do this for me?


Many thanks for any replies,
Regards,
Dave Moore- Hide quoted text -


- Show quoted text -




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
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 help Ant Excel Worksheet Functions 4 August 10th 05 09:02 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 06:40 AM.

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"