Number Of Occurrence

kelvin_9

Active Member
Joined
Mar 6, 2015
Messages
460
Office Version
  1. 2019
[TABLE="class: outer_border, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]sunday[/TD]
[TD]monday[/TD]
[TD]tuesday[/TD]
[TD]wednesday[/TD]
[TD]thursday[/TD]
[TD]friday[/TD]
[TD]saturday[/TD]
[/TR]
[TR]
[TD]peter[/TD]
[TD][TABLE="width: 82"]
<tbody>[TR]
[TD="class: xl66, width: 82"]09:30 - 15:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][TABLE="width: 82"]
<tbody>[TR]
[TD="class: xl66, width: 82"]15:00 - 22:45[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][TABLE="width: 82"]
<tbody>[TR]
[TD="class: xl66, width: 82"]09:30 - 15:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]amy[/TD]
[TD][/TD]
[TD][TABLE="width: 82"]
<tbody>[TR]
[TD="class: xl66, width: 82"]09:30 - 19:00[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][TABLE="width: 82"]
<tbody>[TR]
[TD="class: xl66, width: 82"]13:15 - 22:45[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD]09:30 - 19:00[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]before 13:00[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]2[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]after 13:00[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]

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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
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,224,823
Messages
6,181,180
Members
453,021
Latest member
Justyna P

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