Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Member
 
Location: Birmingham
Posts: 35
Default How to count non blank cells with a condition?

Hi all,

I need to count non blank cells in a column where the date for that row (but different column) falls between two dates

For Example...

_______A_________B

1__05/04/2008___TEXT
2__16/10/2011___
3__29/03/2010___
4__09/12/2011___TEXT
5__01/01/2010___TEXT

I need to count all of the non blank cells in column B where the date in Column A is between or equal to 01/04/2008 & 31/03/2010.

In the example there is only B3 that matches this criteria so the formula should return 1.

Anyone know how to do that?

Many thanks

Jason
  #2   Report Post  
Member
 
Location: Birmingham
Posts: 35
Default

Quote:
Originally Posted by Jay07 View Post
Hi all,

I need to count non blank cells in a column where the date for that row (but different column) falls between two dates

For Example...

_______A_________B

1__05/04/2008___TEXT
2__16/10/2011___
3__29/03/2010___
4__09/12/2011___TEXT
5__01/01/2010___TEXT

I need to count all of the non blank cells in column B where the date in Column A is between or equal to 01/04/2008 & 31/03/2010.

In the example there is only B3 that matches this criteria so the formula should return 1.

Anyone know how to do that?

Many thanks

Jason

Perhaps I should elaborate...

I know how to count all of the dates in column A that fall between or are equal to 01/04/2008 & 31/03/2010 by putting these dates in say cell D1 & D2 and then the use of a sum product...

=SUMPRODUCT((A1:A5<=d2)*(A1:A5=D1))

And I also know how to count all of the blank cells in column B with a simple counta...

=COUNTA(B1:B5)


So I need to basically combine the two of them. But that's where I get lost.
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,872
Default How to count non blank cells with a condition?

Hi Jason,

Am Wed, 15 Aug 2012 12:36:45 +0000 schrieb Jay07:

_______A_________B

1__05/04/2008___TEXT
2__16/10/2011___
3__29/03/2010___
4__09/12/2011___TEXT
5__01/01/2010___TEXT

I need to count all of the non blank cells in column B where the date in
Column A is between or equal to 01/04/2008 & 31/03/2010.


try:
=SUMPRODUCT(--(LEN(B1:B100)0),--(A1:A100=DATE(2008,4,1)),--(A1:A100<=DATE(2010,3,31)))


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
  #4   Report Post  
Member
 
Location: Birmingham
Posts: 35
Default

Quote:
Originally Posted by Claus Busch View Post
Hi Jason,

Am Wed, 15 Aug 2012 12:36:45 +0000 schrieb Jay07:

_______A_________B

1__05/04/2008___TEXT
2__16/10/2011___
3__29/03/2010___
4__09/12/2011___TEXT
5__01/01/2010___TEXT

I need to count all of the non blank cells in column B where the date in
Column A is between or equal to 01/04/2008 & 31/03/2010.


try:
=SUMPRODUCT(--(LEN(B1:B100)0),--(A1:A100=DATE(2008,4,1)),--(A1:A100<=DATE(2010,3,31)))


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2
Thank you Claus, that seems to be what I'm looking for.

It worked fine when applying it to the example I used however when I've tried adapting it to the workbook I'm trying to use this in it keeps reading '0' and I've no idea why. Mind having a look and tell me if it's anything obvious...

=SUMPRODUCT((LEN('PM Orders'!$N$3:$N$65277)0)*('PM Orders'!$O$3:$O$65277=DATE(2008,4,1))*('PM Orders'!$O$3:$O$65277<=DATE(2010,3,31)))

The only thing I can think of is that the cells included in the range N3:N65277 I'm using an indirect data validation with a drop down list of options - that shouldn't effect it though should it??
  #5   Report Post  
Member
 
Location: Birmingham
Posts: 35
Default

Quote:
Originally Posted by Jay07 View Post
Thank you Claus, that seems to be what I'm looking for.

It worked fine when applying it to the example I used however when I've tried adapting it to the workbook I'm trying to use this in it keeps reading '0' and I've no idea why. Mind having a look and tell me if it's anything obvious...

=SUMPRODUCT((LEN('PM Orders'!$N$3:$N$65277)0)*('PM Orders'!$O$3:$O$65277=DATE(2008,4,1))*('PM Orders'!$O$3:$O$65277<=DATE(2010,3,31)))

The only thing I can think of is that the cells included in the range N3:N65277 I'm using an indirect data validation with a drop down list of options - that shouldn't effect it though should it??
Never mind, the formula worked just fine. What it was is that I had changed the time/date system from 1904 to 1907 which then screwed with all my dates in column O.

The formula was right though which is why it was showing '0'


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
counting non blank cells according to a condition hayleyho Excel Discussion (Misc queries) 6 June 28th 09 05:55 PM
count cf cells displaying condition 3 DAN Excel Discussion (Misc queries) 5 March 10th 08 07:19 PM
Count cells with condition Amanda Excel Worksheet Functions 2 October 13th 07 06:59 PM
Count filtered cells meeting a condition Joe M. Excel Discussion (Misc queries) 0 July 26th 07 04:14 PM
how do I count pairs of cells when each matches a condition? Richard pile Excel Discussion (Misc queries) 4 February 20th 06 07:59 PM


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