# COUNT Formula Help

#### KuraiChikara

##### Board Regular
Hello,
I need to find out how many calls come in, for any given day in a month from 7a-7p,.
Criteria is in hour increments 7a-8a, 8a-9a, 9a-10a, 10a-11a, 11a-12p, 12p-1p, 1p-2p, 2p-3p, 3p-4p, 4p-5p, 5p-6p, 6p-7p (12 possible groupings).

Example: if I had calls from 07:01, 07:59, 08:00 and 08:59 all come in 03/26/2019 that would be counted as 4 calls for that day between the range of 7a-8a.

Data:
A2 would contain the date format IE 03/01/2019, 03/02/2019 ' ' ' ' ' ' '03/26/2019, etc
B2 would contain random times from 07:00 to 19:00 IE 07:59, 10:13, 19:59, etc
C3 would have the formula to give me a counted result with the 12 possible grouping criteria that I mentioned which I don't know how to do

I don't know what formula would make this easiest to accomplish, I was thinking =LOOKUP but I'm not sure that will help me. I know I could do a possible nested count if or count ifs but that'll make my sheet large. I'm hopefully looking for a simpler method.

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

#### RasGhul

##### Well-known Member
Hi Kurai,

Can you use this?

Book1
ABC
1DateTimesTimestamp
225-03-197:0125-03-19 7:01
325-03-199:3025-03-19 9:30
425-03-1913:0025-03-19 13:00
525-03-1917:3025-03-19 17:30
626-03-198:3626-03-19 8:36
726-03-199:1026-03-19 9:10
826-03-1911:1126-03-19 11:11
926-03-1912:4526-03-19 12:45
1026-03-197:5026-03-19 7:50
1126-03-197:0126-03-19 7:01
1226-03-199:3026-03-19 9:30
1327-03-1913:0027-03-19 13:00
1427-03-1917:3027-03-19 17:30
1527-03-198:3627-03-19 8:36
1627-03-199:1027-03-19 9:10
1727-03-1911:1127-03-19 11:11
1827-03-1912:4527-03-19 12:45
1927-03-197:5027-03-19 7:50
2027-03-198:5027-03-19 8:50
Sheet1
Cell Formulas
RangeFormula
C2=A2+B2

Book1
ABCDEFGHIJKL
1Date26-03-19
2Day Count7
3
47:00 AM8:00 AM9:00 AM10:00 AM11:00 AM12:00 PM1:00 PM2:00 PM3:00 PM4:00 PM5:00 PM6:00 PM
58:00 AM9:00 AM10:00 AM11:00 AM12:00 PM1:00 PM2:00 PM3:00 PM4:00 PM5:00 PM6:00 PM7:00 PM
621211
Sheet2
Cell Formulas
RangeFormula
B2=COUNTIFS(Sheet1!\$A\$2:\$A\$20,">="&Sheet2!\$B\$1,Sheet1!\$A\$2:\$A\$20,"<"&(Sheet2!\$B\$1+1))
A6=COUNTIFS(Sheet1!\$C\$2:\$C\$20,">="&(Sheet2!\$B\$1+Sheet2!A\$4),Sheet1!\$C\$2:\$C\$20,"<"&(Sheet2!\$B\$1+Sheet2!A\$5))

#### etaf

##### Well-known Member
use a countifs for each hour range

=COUNTIFS(B2:B1000," > = "&TIMEVALUE("7:00"),B2:B1000," < = "&TIMEVALUE("19:00"),A2:A1000,DATEVALUE("27/3/18"))
where B2:B1000 is the range of times
A2:A1000 is the dates
Change these to suite your data range

Date I have hardcoded but you could change that to reference a particular cell - so the count changes based on the date in that cell

groups
Is this a typo
Example: if I had calls from 07:01, 07:59, 08:00 and 08:59 all come in 03/26/2019 that would be counted as 4 calls for that day between the range of 7a-8a.

8:59 would be a different hour group
If you want each hour group
then

=COUNTIFS(B2:B1000," > ="&TIMEVALUE("7:00"),B2:B1000," < "&TIMEVALUE("8:00"),A2:A1000,DATEVALUE("27/3/18"))
=COUNTIFS(B2:B1000," > ="&TIMEVALUE("8:00"),B2:B1000," < "&TIMEVALUE("9:00"),A2:A1000,DATEVALUE("27/3/18"))

repeat for each hour
NOT this will NOT include 19:00 . as i just have less than
so the last group
=COUNTIFS(B2:B1000," > ="&TIMEVALUE("18:00"),B2:B1000," < ="&TIMEVALUE("19:00"),A2:A1000,DATEVALUE("27/3/18"))
changes to < =

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,302
Messages
5,836,504
Members
430,436
Latest member
fefenouil

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