Count unique values within a hourly time range

legend2009

New Member
Joined
Aug 9, 2013
Messages
2
Hello,

I need to count how many unique "operator codes" are active within certain intervals throughout the day. I do not want to use a pivot table. I've failed trying to adapt similar formulas for date ranges. Any ideas? Sample data is below. For example, for time range 7:00 to 8:00 AM, there are 5 rows but only 3 unique "operator codes".

Arrival TimeOperator
2:30 PMBBB
9:47 AMBBB
6:45 AMAAA
7:34 AMBBB
7:47 AMAAA
7:50 AMBBB
7:32 AMBBB
2:27 PMAAA
2:32 PMAAA
7:45 AMCCC
8:45 AMBBB
2:37 PMAAA

<tbody>
</tbody>
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Just figured it out. Here is an example formula for anyone looking later:

=SUM(IF(FREQUENCY(IF(A1:A9>=TIME(7,0,0),IF(A1:A9<=TIME(8,0,0),MATCH("~"&B1:B9,B1:B9&"",0))),ROW(B1:B9)-ROW(B1)+1),1))

My times are in column A and the data is in column B.

This does require CTRL - SHIFT - ENTER.
 
Upvote 0

Forum statistics

Threads
1,215,686
Messages
6,126,202
Members
449,298
Latest member
Jest

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