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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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
Just an observation...

If you're wanting to count all dates within the year 2011 then your formula is not counting any dates of 1/1/2011.

You would want:

=COUNTIF(range,">="&DATE(2011,1,1))-COUNTIF(range,">"&DATE(2011,12,31))

Or:

=SUMPRODUCT(--(YEAR(range)=2011))
 
Upvote 0

Forum statistics

Threads
1,225,155
Messages
6,183,212
Members
453,151
Latest member
Lizamaison

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