ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Conditional math
  3. How to Count by Hour in Excel for Calls, Orders or Visits

How to Count by Hour in Excel for Calls, Orders or Visits

By ExcelReady Team·Updated November 3, 2026·6 min read

The short answer

To count by hour in Excel, add a helper column with =HOUR(B2), which returns the hour from 0 to 23. Then list the hours and count each one with =COUNTIF($C$2:$C$100,E2). Without a helper column, use COUNTIFS with time limits: =COUNTIFS(B2:B100,">="&TIME(9,0,0),B2:B100,"<"&TIME(10,0,0)).

Key takeaways

  • Excel stores a time as part of a day, so 9:00 is 0.375 and 12:00 is 0.5.
  • =HOUR(B2) returns the hour from 0 to 23, for plain times and for full date-time stamps.
  • COUNTIF on the hour column counts each hour; COUNTIFS adds conditions such as channel or day.
  • For limits without a helper, use >= the start time and < the next hour, so no record is counted twice.
  • Times stored as text don't count; convert them with VALUE or TIMEVALUE first.
On this page+
  1. How Excel stores times
  2. Method 1: HOUR helper column and COUNTIF
  3. Method 2: COUNTIFS with time limits
  4. Add more conditions with COUNTIFS
  5. Count by hour with date-time stamps
  6. Group by hour in a pivot table
  7. Why your count by hour is wrong
  8. Practise it

To count by hour in Excel, you pull the hour out of each time with HOUR and then count how often each hour appears with COUNTIF or COUNTIFS. That turns a long log of calls, orders or website visits into a simple table of busy and quiet hours, which is what you need for staffing and scheduling. This guide shows the helper-column method, a no-helper COUNTIFS formula, date-time stamps, a pivot table option and the fixes for counts that come out wrong.

How Excel stores times#

Excel stores a time as a fraction of one day. Midnight is 0, 6:00 is 0.25, 9:00 is 0.375 and 12:00 is 0.5. A date and time together, such as 3 Nov 2026 09:15, is a whole number for the date plus that fraction.

This matters for counting. You can't write =COUNTIF(B2:B9,9), because no time equals the number 9. You need either the hour as its own number, or time limits written with the TIME function. The date basics lesson explains how dates and times are stored.

All the examples below use this call log. The times in column B are real Excel times:

ABCD
1CallTimeHourChannel
2C-0108:528Phone
3C-0209:059Chat
4C-0309:419Phone
5C-0410:1510Phone
6C-0510:5810Chat
7C-0611:2011Chat
8C-0713:0713Phone
9C-0809:599Phone

Method 1: HOUR helper column and COUNTIF#

The most reliable way to count by hour is a helper column that holds the hour as a plain number. In C2, type:

Excel formula
=HOUR(B2)

Fill it down. HOUR returns a whole number from 0 to 23, so 09:59 becomes 9 and 13:07 becomes 13. It drops the minutes; it does not round them.

Now build a summary table. Type the hours 8 to 13 in F2:F7, and in G2:

Excel formula
=COUNTIF($C$2:$C$9,F2)

Fill it down. The results are:

HourCalls
81
93
102
111
120
131

The $ signs lock the hour column so it stays put as you fill. For readable labels such as "9:00 - 10:00", use =TEXT(F2/24,"h:mm")&" - "&TEXT((F2+1)/24,"h:mm"), because dividing an hour by 24 turns it back into a time.

Method 2: COUNTIFS with time limits#

If you don't want a helper column, count the times between two limits with COUNTIFS. This counts calls from 9:00 up to, but not including, 10:00:

Excel formula
=COUNTIFS(B2:B9,">="&TIME(9,0,0),B2:B9,"<"&TIME(10,0,0))

The result is 3 (09:05, 09:41 and 09:59). The same column appears twice, once for each limit, and a record is counted only if it meets both. TIME(9,0,0) builds the time 9:00, and & joins it to the operator. Our article on counting between two dates with COUNTIFS uses the same "from and to" pattern.

Use >= for the start and < for the end. If you used <= with 10:00, a call at exactly 10:00:00 would be counted in two hours.

To count several hours at once, compare the helper column with a range: =COUNTIFS(C2:C9,">=9",C2:C9,"<=11") returns 6, the calls from 9:00 to 11:59.

Add more conditions with COUNTIFS#

COUNTIFS can add any other condition to the hour. To count only phone calls in the 9 o'clock hour:

Excel formula
=COUNTIFS(C2:C9,9,D2:D9,"Phone")

The result is 2 (C-03 and C-08). A grid of hours down the side and channels across the top, with a formula like =COUNTIFS($C$2:$C$9,$F2,$D$2:$D$9,G$1), shows the busiest hour for each channel. The COUNTIFS function guide and the article on COUNTIFS and SUMIFS with multiple conditions cover more criteria.

The same grid works for day of the week and hour. Add a second helper with =TEXT(B2,"ddd") for the day name, then count with both conditions. A colour scale from Home > Conditional Formatting turns it into a heat map of busy times.

Count by hour with date-time stamps#

Many systems export a date and time in one cell. HOUR still works, because it ignores the date part: =HOUR(B2) returns 14 for 3 Nov 2026 14:25.

The COUNTIFS time-limit method does not ignore the date. A value like 3 Nov 2026 09:15 is a large number, far above TIME(10,0,0), so it never falls between the limits. You have two options:

  • Use the HOUR helper column, as in Method 1. This is the simplest choice.
  • Count one specific day and hour by adding the date to each limit. With the date in H1: =COUNTIFS(B2:B9,">="&H1+TIME(9,0,0),B2:B9,"<"&H1+TIME(10,0,0)).

To count by day rather than by hour, the same ideas apply; see how to count by month for date-based grouping.

Group by hour in a pivot table#

A pivot table counts by hour without any formulas:

  1. Select the data and choose Insert > PivotTable.
  2. Drag the Time field to Rows and the Call field to Values, so it shows a count.
  3. Right-click any time in the pivot and choose Group.
  4. Select Hours only, deselect the other units, and click OK.

If the times include dates and you want one row per hour across all days, select only Hours. To split the hours by date as well, also select Days, Months and Years. If Group is greyed out or shows an error, the column contains text or blank cells.

Why your count by hour is wrong#

Most wrong counts come from the data, not the formula:

  1. Times stored as text. Imported times often arrive as text, which sits on the left of the cell. HOUR can still read a text time like "09:15", but COUNTIFS limits can't. Convert the column with =VALUE(B2) or =TIMEVALUE(B2) and format it as a time.
  2. Rounded times. If times were rounded, a call at 9:58 may now show as 10:00 and move hour. See how to round time in Excel before you round.
  3. Durations instead of clock times. A column of call lengths is not a start time. For lengths, see calculating the difference between two times.
  4. Midnight shifts. Hour 0 is midnight to 12:59 AM. Make sure your summary list starts at 0, not 1.

Practise it#

Try the exercise on this page to count calls between 9:00 and 11:59 with COUNTIFS. Then practise COUNTIFS and SUMIFS in a live spreadsheet, and practise how Excel stores dates in the date basics lesson. Each lesson checks your formula as soon as you type it.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Column C holds the hour each call started (the result of =HOUR(B2) in Excel). In F2, count the calls from 9:00 to 11:59, that is, hours 9 to 11. Use COUNTIFS.

fx
ABCDEFG
1
Call
Time
Hour
Channel
2
C-01
08:52
8
Phone
Hours 9-11
3
C-02
09:05
9
Chat
4
C-03
09:41
9
Phone
5
C-04
10:15
10
Phone
6
C-05
10:58
10
Chat
7
C-06
11:20
11
Chat
8
C-07
13:07
13
Phone
9
C-08
09:59
9
Phone
10
11
12

Tip: Use the Hour column twice: once with ">=9" and once with "<=11".

Practise this in a lesson

LessonCOUNTIFS and SUMIFSCount and sum with several conditions at once, and learn why SUMIFS puts the sum range first.LessonHow Excel stores dates: DATE, YEAR, MONTH, DAYLearn why every date is secretly a number, then build dates with DATE and take them apart with YEAR, MONTH and DAY.Function guideCOUNTIFSCount rows that meet several conditions with COUNTIFS. Examples for text, number ranges and between-values, plus a live exercise.

Frequently asked questions

How do I count the number of entries per hour in Excel?

+

Add a helper column with =HOUR(B2) next to your times, then list the hours 0 to 23 and use =COUNTIF($C$2:$C$100,E2) beside each one. A pivot table grouped by Hours gives the same counts.

How do I count times between two times in Excel?

+

Use COUNTIFS with two conditions on the same column: =COUNTIFS(B2:B100,">="&TIME(9,0,0),B2:B100,"<"&TIME(10,0,0)) counts times from 9:00 up to, but not including, 10:00.

Does HOUR work with a date and time in the same cell?

+

Yes. HOUR ignores the date part, so =HOUR(B2) returns 14 for 3/11/2026 14:25. COUNTIFS with TIME limits does not ignore the date, so use the HOUR helper for date-time stamps.

Why does my count by hour return 0?

+

The times are usually stored as text, often after an import. Text times sit on the left of the cell. Convert them with =VALUE(B2) or Text to Columns, then count again.

How do I group times by hour in a pivot table?

+

Put the time field in Rows, right-click any time, choose Group, select only Hours and click OK. Then add any field to Values as a count.

Sources

  • COUNTIFS function - Microsoft Support
  • COUNTIF function - Microsoft Support
  • Create a PivotTable to analyze worksheet data - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How Excel stores times
  2. Method 1: HOUR helper column and COUNTIF
  3. Method 2: COUNTIFS with time limits
  4. Add more conditions with COUNTIFS
  5. Count by hour with date-time stamps
  6. Group by hour in a pivot table
  7. Why your count by hour is wrong
  8. Practise it

Keep reading

Conditional math· 7 min read

COUNTIFS and SUMIFS: Multiple Conditions in Excel

COUNTIFS counts rows that meet several conditions, and SUMIFS adds numbers from those rows. Each condition is a pair: a range, then its criteria. A row counts only if it matches every pair. SUMIFS puts the sum range first: =SUMIFS(E2:E9,A2:A9,"North",C2:C9,"Laptop") totals North laptop revenue.

Conditional math· 5 min read

COUNTIFS With a Date Range in Excel

To count dates in a range, use COUNTIFS with two conditions on the same date column: =COUNTIFS(B2:B9,">="&F1,B2:B9,"<="&F2), where F1 is the start date and F2 is the end date. The operators go in quotes, joined to the date with &. Add more range and criteria pairs to count by region or status too.

Dates· 6 min read

Calculate the Difference Between Two Times in Excel

To calculate the difference between two times in Excel, subtract the start time from the end time: =C2-B2. Format the result as h:mm to see hours and minutes, or multiply by 24 to get decimal hours: =(C2-B2)*24. For shifts that end after midnight, use =MOD(C2-B2,1) so the result is never negative.

More on conditional math

  • How to Count Cells With Text in Excel
  • Count and Sum Colored Cells in Excel
  • How to Count Duplicates in Excel
  • How to Count Unique Values in Excel
  • How to Count Yes, No and Ticks in Excel
  • How to Use COUNTIF in Excel (With Criteria Examples)
All conditional math articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free