# Number Of Occurrence

#### kelvin_9

##### Active Member
sundaymondaytuesdaywednesdaythursdayfridaysaturday
peter
 09:30 - 15:00

<tbody>
</tbody>
 15:00 - 22:45

<tbody>
</tbody>
 09:30 - 15:00

<tbody>
</tbody>
amy
 09:30 - 19:00

<tbody>
</tbody>
 13:15 - 22:45

<tbody>
</tbody>
09:30 - 19:00
before 13:001100020
after 13:000011000

<tbody>
</tbody>

hello all,
with this table of my staff schedule, i would like to count the occurrence of daily before 13:00 / after 13:00, how can i do this like "left and countif"?
format cell need to be hh:mm

### Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

any idea?

#### AlanY

##### Well-known Member
try this

Book1
ABCDEFG
1sundaymondaytuesdaywednesdaythursdayfridaysaturday
2peter09:30 - 15:0015:00 - 22:4509:30 - 15:00
3
4amy09:30 - 19:0013:15 - 22:4509:30 - 19:00
5
6before 13:00110002
7after 13:00001100
Sheet1
Cell Formulas
RangeFormula
B6{=SUM(IF(B2:B4="",0,IF(0+LEFT(B2:B4,5)13,0,0),1,0)))}
B7{=SUM(IF(B2:B4="",0,IF(0+LEFT(B2:B4,5)>=TIME(13,0,0),1,0)))}
Press CTRL+SHIFT+ENTER to enter array formulas.

#### FormR

##### MrExcel MVP
Hi, another option you can try:

Excel 2013/2016
ABCDEFG
1sundaymondaytuesdaywednesdaythursdayfridaysaturday
2peter13:00 - 15:0015:00 - 22:4509:30 - 15:00
3
4amy09:30 - 19:0013:15 - 22:4509:30 - 19:00
5
6before 13:00110002
7after 13:00001100
Sheet1
Cell Formulas
RangeFormula
B6=COUNTIFS(B2:B4,"<=13:00 - 99:99")
B7=COUNTIFS(B2:B4,">13:00 - 99:99")

#### kelvin_9

##### Active Member
both of you are life saver
thanks for the great solution

i have another formula/macros issue

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,214
Messages
5,836,045
Members
430,402
Latest member
bcurran2

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