Counting the number of cells that are in a date range?

anewc1

Board Regular
Joined
Sep 8, 2005
Messages
180
I would like to count how many employees have hire dates between two specific dates.

Employee Name Hire Date
Doe, Jane 7/31/06
Doe, Jim 8/5/06

Anyone know how to do this easily? DCOUNT is really confusing me. Thanks!
 

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.
You can try using Countif():

If you want your dates hard-coded in the formula:

e.g.
=COUNTIF($B$2:$B$10,">7/30/2006")-COUNTIF($B$2:$B$10,">=8/5/2006")

If you want to reference dates in cells

e.g
=COUNTIF($B$2:$B$10,">"&G5)-COUNTIF($B$2:$B$10,">="&G6)


Where B2:B10 house the Hire Dates

G5 and G6 hire reference start & end dates.
 
Upvote 0
That didn't work. This is what the formula ended up being:

=COUNTIF($D$1:$D$1000,">"&L45)-COUNTIF($D$1:$D$1000,">="&L46)

Where L45 is 7/31/06 and L46 is 8/5/06. The value returned should have been 3 and it gave me 49.
 
Upvote 0
Here's what I get using your formula and some random dates in column D:
Book2
DEFG
15-Jul4
2
3
431-Jul
5
64-Aug
7
8
9
10
1110-Aug
12
13
14
153-Aug
16
17
18
19
2010-Jun
21
22
232-Aug
24
25
Sheet1


Double-check your entries and your start/end dates to make sure they are compatible.
 
Upvote 0
Got it. I had to use this:

=COUNTIF($D$2:$D$100,">=7/31/2006")-COUNTIF($D$2:$D$100,">8/5/2006")

Thanks for your help, this will save me LOADS of time! :biggrin:
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

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