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

#### anewc1

##### Board Regular
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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

#### NBVC

##### Well-known Member
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.

#### anewc1

##### Board Regular
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.

#### NBVC

##### Well-known Member
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.

#### anewc1

##### Board Regular
Got it. I had to use this:

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

Replies
5
Views
208
Replies
1
Views
45
Replies
3
Views
63
Replies
8
Views
469
Replies
5
Views
214

1,136,927
Messages
5,678,621
Members
419,776
Latest member
mikelowski

### 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.

### Which adblocker are you using?

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

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