Number Of Occurrence

kelvin_9

Board Regular
Joined
Mar 6, 2015
Messages
248
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
 

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

AlanY

Well-known Member
Joined
Oct 30, 2014
Messages
4,170
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
try this

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">sunday</td><td style=";">monday</td><td style=";">tuesday</td><td style=";">wednesday</td><td style=";">thursday</td><td style=";">friday</td><td style=";">saturday</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">peter</td><td style=";">09:30 - 15:00</td><td style="text-align: right;;"></td><td style=";">15:00 - 22:45</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">09:30 - 15:00</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">amy</td><td style="text-align: right;;"></td><td style=";">09:30 - 19:00</td><td style="text-align: right;;"></td><td style=";">13:15 - 22:45</td><td style="text-align: right;;"></td><td style=";">09:30 - 19:00</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style=";">before 13:00</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style="text-align: right;;">0</td><td style="text-align: right;;">0</td><td style="text-align: right;;">0</td><td style="text-align: right;;">2</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">7</td><td style=";">after 13:00</td><td style="text-align: right;;">0</td><td style="text-align: right;;">0</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style="text-align: right;;">0</td><td style="text-align: right;;">0</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B6</th><td style="text-align:left">{=SUM(<font color="Blue">IF(<font color="Red">B2:B4="",0,IF(<font color="Green">0+LEFT(<font color="Purple">B2:B4,5</font>)<TIME(<font color="Purple">13,0,0</font>),1,0</font>)</font>)</font>)}</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B7</th><td style="text-align:left">{=SUM(<font color="Blue">IF(<font color="Red">B2:B4="",0,IF(<font color="Green">0+LEFT(<font color="Purple">B2:B4,5</font>)>=TIME(<font color="Purple">13,0,0</font>),1,0</font>)</font>)</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.
<b>Note: Do not try and enter the {} manually yourself</b></td></tr></table><br />
 

FormR

MrExcel MVP
Joined
Aug 18, 2011
Messages
6,430
Office Version
  1. 365
Platform
  1. Windows
Hi, another option you can try:

<b>Excel 2013/2016</b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th><th>D</th><th>E</th><th>F</th><th>G</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">sunday</td><td style=";">monday</td><td style=";">tuesday</td><td style=";">wednesday</td><td style=";">thursday</td><td style=";">friday</td><td style=";">saturday</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">peter</td><td style=";">13:00 - 15:00</td><td style="text-align: right;;"></td><td style=";">15:00 - 22:45</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style=";">09:30 - 15:00</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">amy</td><td style="text-align: right;;"></td><td style=";">09:30 - 19:00</td><td style="text-align: right;;"></td><td style=";">13:15 - 22:45</td><td style="text-align: right;;"></td><td style=";">09:30 - 19:00</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td><td style="text-align: right;;"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">6</td><td style=";">before 13:00</td><td style="text-align: right;background-color: #FFFF00;;">1</td><td style="text-align: right;;">1</td><td style="text-align: right;;">0</td><td style="text-align: right;;">0</td><td style="text-align: right;;">0</td><td style="text-align: right;;">2</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">7</td><td style=";">after 13:00</td><td style="text-align: right;background-color: #FFFF00;;">0</td><td style="text-align: right;;">0</td><td style="text-align: right;;">1</td><td style="text-align: right;;">1</td><td style="text-align: right;;">0</td><td style="text-align: right;;">0</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B6</th><td style="text-align:left">=COUNTIFS(<font color="Blue">B2:B4,"<=13:00 - 99:99"</font>)</td></tr><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">B7</th><td style="text-align:left">=COUNTIFS(<font color="Blue">B2:B4,">13:00 - 99:99"</font>)</td></tr></tbody></table></td></tr></table><br />
 

kelvin_9

Board Regular
Joined
Mar 6, 2015
Messages
248
both of you are life saver
thanks for the great solution

i have another formula/macros issue
 

Watch MrExcel Video

Forum statistics

Threads
1,109,044
Messages
5,526,439
Members
409,701
Latest member
nitmani

This Week's Hot Topics

Top