Countif and dates

ChrisHJH

New Member
Joined
Sep 5, 2011
Messages
5
Hi,

I have several coumns of data, all of them are dates. I want to add some statistical information in the worksheet telling me which dates are in which range in several of the columns.

I thought countif would be ideal for this so set about using it ... and this is where I need help

=countif(a:a, ">01/01/2011") - this works fine!

=countif(b:b, and(">01/01/2011","<01/01/2012")) - this returned 5 but I could count at least 50 rows which were between the two dates

I have made sure all the rows are formatted as date

Help please!

Thanks

Chris
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try

=countif(b:b, ">"&"01/01/2011"+0)-COUNTIF(b:b,">"&"01/01/2012"+0)
 
Upvote 0
Working here

Excel Workbook
BCD
105/09/20116
225/09/2011
315/10/2011
404/11/2011
524/11/2011
614/12/2011
703/01/2012
823/01/2012
912/02/2012
1003/03/2012
Sheet4
 
Upvote 0
Are your dates left- or right-aligned in the cells (if you don't specifically align them to one or the other)
 
Upvote 0
OK, I've had some time to play with this and I'm starting to get a bit closer but nothing anyone has suggested yet works for me

I have a date .... 01/01/2010

Using this in the count if function just doesn't seem to work.

I've been playing with the date value function and I seem to be getting somewhere.

=Datevalue("01/01/2010") returns 40179

This seems to accept the date as an argument and change it to a number so I can then do some simple integer maths.

So, all I need to do is use the column reference .... wrong

I've tried to add quotes in front of the date using all kinds of things but I just can't seem to get a formula to add quotes in front of a cell to give me the date .... "01/01/2010" ... which I can then work with

Can anyone help please?

TIA

Chris
 
Upvote 0
By any chance are your dates actually date plus time, formatted to show only the date?
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,730
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top