Counting number of Mon, Tue, Wed, etc. worked within time-frame

JamesonMH

Board Regular
Joined
Apr 17, 2018
Messages
120
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I need to calculate how many Mondays, Tuesday's etc. an employee worked over a given time frame. It's not as simple as "tell me the # of Monday's between January and May.'

See my condensed example using Thursday (i.e. how many Thursday's did this employee work between January and May? The answer I'm looking for via formula is 3 since the other Thursdays are duplicates.

Also note, I won't have the helper column #2 below in my report (Day of week) - I just put that in for clarity.

Many thanks for your time!

DateDay of week (info only)Count
Jan 11, 2018Thursday1
Jan 11, 2018Thursday
Feb 7, 2018Wednesday
Feb 8, 2018Thursday1
Feb 8, 2018Thursday
Feb 22, 2018Thursday1
Feb 22, 2018Thursday

<tbody>
</tbody>

James
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Try:

ABCDEFGHI
1DateDay of week (info only)CountStartEndDOWCount
211-Jan-18Thursday11/1/20185/31/2018Thursday3
311-Jan-18Thursday
47-Feb-18Wednesday
58-Feb-18Thursday1
68-Feb-18Thursday
722-Feb-18Thursday1
822-Feb-18Thursday
9

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet4

Array Formulas
Ce
ll
Formula
H2{=SUM(SIGN(FREQUENCY(IF($A$2:$A$20>=E2,IF($A$2:$A$20<=F2,IF(TEXT($A$2:$A$20,"ddd")=LEFT(G2,3),$A$2:$A$20))),$A$2:$A$20)))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0
Try:

ABCDEFGHI
1DateDay of week (info only)CountStartEndDOWCount
211-Jan-18Thursday11/1/20185/31/2018Thursday3
311-Jan-18Thursday
47-Feb-18Wednesday
58-Feb-18Thursday1
68-Feb-18Thursday
722-Feb-18Thursday1
822-Feb-18Thursday
9

<tbody>
</tbody>
Sheet4

Array Formulas
Ce
ll
Formula
H2{=SUM(SIGN(FREQUENCY(IF($A$2:$A$20>=E2,IF($A$2:$A$20<=F2,IF(TEXT($A$2:$A$20,"ddd")=LEFT(G2,3),$A$2:$A$20))),$A$2:$A$20)))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>

Thanks Eric, this works good! I wouldn't need to test the date range though with an IF as all of the data dumped in my spreadsheet will already be filtered with the relevant date range. How would the formula look if modified to remove those IF conditions? Thanks again.

James
 
Upvote 0
Try this:

=SUM(SIGN(FREQUENCY(IF(TEXT($A$2:$A$20,"ddd")=LEFT(G2,3),$A$2:$A$20),$A$2:$A$20)))

Works perfectly Eric - thank you again! It's impressive how you not only solved my problem using a couple of functions that aren't overly common, but that you also came up with the solution so quickly.
 
Upvote 0
You're very welcome! I've done this a while, and I've learned a few tricks, but I'm constantly learning new things about Excel. I like puzzles, and this kind of questions are right up my alley! :)
 
Upvote 0

Forum statistics

Threads
1,215,358
Messages
6,124,487
Members
449,165
Latest member
ChipDude83

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