Countif formula within 2 date ranges

da_vide78

Board Regular
Joined
Mar 6, 2007
Messages
73
hi there.


I've trawled the site and web but can't find anything that works.


I have a table of data with each line having a start and end date. I need to work out how many activities happen between 2 set end dates. Below is a sample.


A B C
1 Activity Start End
2 Activity 1 21/3/11 23/3/11
3 Activity 2 25/3/11 30/3/11
4 Activity 3 2/4/11 04/04/11
5 Activity 4 5/4/11 06/04/11
6 Activity 5 5/4/11 08/04/11

I can't seem to make my countif formula take into account a 'greater than' and 'smaller than' request.

Any help would be appreciated?

Cheers
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
As an example:

=COUNTIF("B2:B6","<="&D1)

I assume cell D1 holds the date with which you want to compare.
You can extend the logic to also have a test on >= for example.
 
Upvote 0
It depends which version of excel.

2007 or later =COUNTIFS(B2:B6,">"& start date,B2:B6,"<"& end date)

2003 or older

= COUNTIF(B2:B6,"<"& end date)-COUNTIF(B2:B6,"<="& start date)
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,823
Members
452,946
Latest member
JoseDavid

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