Counting Unique Dates Based on Criteria

gbc123

New Member
Joined
May 6, 2004
Messages
30
Hi Folks,

Struggling with this, even having read threads here about functions that may help.

Looking to total unique dates based on criteria in another cell (not an overall total of unique dates).

e.g.
A B C D E F G
Resource Name Position Hours Date Day Day Type
1234567 Mrs Munro 100156 0 30/03/2018 School Holiday
1234567 Mrs Munro 101453 0 30/03/2018 School Holiday
1234567 Mrs Munro 100156 0 31/03/2018 School Holiday
1234567 Mrs Munro 101453 0 31/03/2018 School Holiday
1234567 Mrs Munro 100156 0 01/04/2018 School Holiday
1234567 Mrs Munro 101453 0 01/04/2018 School Holiday
1234567 Mrs Munro 100156 0 02/04/2018 School Closure Day
1234567 Mrs Munro 101453 0 02/04/2018 School Closure Day
1234567 Mrs Munro 100156 0 03/04/2018 School Closure Day
1234567 Mrs Munro 101453 0 03/04/2018 School Closure Day
1234567 Mrs Munro 100156 6 04/04/2018 Wednesday Working Day
1234567 Mrs Munro 101453 0 04/04/2018 School Closure Day
1234567 Mrs Munro 100156 2 05/04/2018 Thursday Working Day
1234567 Mrs Munro 101453 3.5 05/04/2018 Thursday Working Day
1234567 Mrs Munro 100156 0 06/04/2018 School Closure Day
1234567 Mrs Munro 101453 0 06/04/2018 School Closure Day

Would like output to be

Distinct count of dates worked where "Day Type" containts "Working Day" with a sum of hours e.g.

Day Days Worked Hours Worked
Wednesday 1 6
Thursday 1 5.5

I do not want the Thursday counted twice.

Would really appreciate assistance!

Thanks.

Gary.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
I'm still a little unclear about how you want the results, but let's try this first and see what you think:

ABCDEFGHIJKLMNOP
1ResourceNamePositionHoursDateDayDay TypeResourceDay TypeDateDayHours
21234567Mrs Munro10015603/30/2018School Holiday 1234567Working Day4/4/2018Wednesday6
31234567Mrs Munro10145303/30/2018School Holiday 4/5/2018Thursday5.5
41234567Mrs Munro10015603/31/2018School Holiday 0
51234567Mrs Munro10145303/31/2018School Holiday 0
61234567Mrs Munro10015604/1/2018School Holiday 0
71234567Mrs Munro10145304/1/2018School Holiday 0
81234567Mrs Munro10015604/2/2018School Closure Day
91234567Mrs Munro10145304/2/2018School Closure Day
101234567Mrs Munro10015604/3/2018School Closure Day
111234567Mrs Munro10145304/3/2018School Closure Day
121234567Mrs Munro10015664/4/2018WednesdayWorking Day
131234567Mrs Munro10145304/4/2018School Closure Day
141234567Mrs Munro10015624/5/2018ThursdayWorking Day
151234567Mrs Munro1014533.54/5/2018ThursdayWorking Day
161234567Mrs Munro10015604/6/2018School Closure Day
171234567Mrs Munro10145304/6/2018School Closure Day

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

Worksheet Formulas
CellFormula
O2=TEXT(N2,"dddd")
P2=SUMIFS(D:D,A:A,$K$2,E:E,N2,G:G,$L$2)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
N2{=IFERROR(SMALL(IF($G$2:$G$17=$L$2,IF(COUNTIF($N$1:$N1,$E$2:$E$17)=0,IF($A$2:$A$17=$K$2,$E$2:$E$17))),ROWS($N$2:$N2)),"")}

<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

Forum statistics

Threads
1,214,641
Messages
6,120,691
Members
448,978
Latest member
rrauni

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