Number Of Occurrence

kelvin_9

Active Member
Joined
Mar 6, 2015
Messages
444
Office Version
  1. 2019
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

thanks all your great answer
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
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.
 
Upvote 0
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")
 
Upvote 0
both of you are life saver
thanks for the great solution

i have another formula/macros issue
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,483
Members
448,967
Latest member
visheshkotha

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