Re: How to calulate hours worked on Sundays in a specific month

KyleOliver

New Member
Joined
Apr 16, 2016
Messages
31
Re: How to calulate hours worked on Sundays in a specific month

Hi,

I would like to know how to add all hours worked on the sundays in a month.
An employee might not work every Sunday in a month. Some employees will work one Sunday, others might work 2 or more and some might not work any Sundays in a month.

My table looks as follows;

<strike></strike><strike></strike>
ABCDEFGH
1Week Day<strike></strike><strike></strike>Punch Date<strike></strike><strike></strike>Time In<strike></strike><strike></strike>Lunch Start<strike></strike><strike></strike>Lunch End<strike></strike><strike></strike>Time Out<strike></strike><strike></strike>Hours Worked<strike></strike>
2Monday01 Aug 201808:0012:0013:0016:007:00
3Tuesday02 Aug 2018
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>
4Wednesday
03 Aug 2018
<strike></strike>
<strike></strike>
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>
5Thursday
04 Aug 2018
<strike></strike>
<strike></strike>
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>
6Friday
05 Aug 2018
<strike></strike>
<strike></strike>
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>
7Saturday
06 Aug 2018
<strike></strike>
<strike></strike>
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>
8Sunday
07 Aug 2018
<strike></strike>
<strike></strike>
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>
9Monday
08 Aug 2018
<strike></strike>
<strike></strike>
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>
10Tuesday
09 Aug 2018
<strike></strike>
<strike></strike>
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>
11Wednesday
10 Aug 2018
<strike></strike>
<strike></strike>
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>
12Thursday
11 Aug 2018
<strike></strike>
<strike></strike>
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>
13Friday
12 Aug 2018
<strike></strike>
<strike></strike>
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>
14Saturday
13 Aug 2018
<strike></strike>
<strike></strike>
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>
15Sunday
14 Aug 2018
<strike></strike>
<strike></strike>
16Monday
15 Aug 2018
<strike></strike>
<strike></strike>
08:00
<strike></strike>
<strike></strike>
12:00
<strike></strike>
<strike></strike>
13:00
<strike></strike>
<strike></strike>
16:00
<strike></strike>
<strike></strike>
7:00
<strike></strike>

<tbody>
</tbody>
<strike></strike>
How do I calculate just the hours worked on a Sunday?
Do I use a SUMIF / SUMIFS / SUMPRODUCT / MATCH / INDEX?

I have no idea, please someone help?

:confused:

Regards,
Kyle
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Re: How to calulate hours worked on Sundays in a specific month

Try

=SUMPRODUCT((B2:B16="Sunday")*(H2:H16))

Do you know that instead of day name you could use date and make the calculation per month
 
Last edited:
Upvote 0
Re: How to calulate hours worked on Sundays in a specific month

Let's assume that in column C there is some Excel date like dd/mm/yyyy
Next formula wil give the hours sum =SUMPRODUCT((WEEKDAY(C2:C16;2)=7)*(MONTH(C2:C16)=8)*(H2:H16))

in column B put = column C with a custom format like dddd it gives the weekday day
 
Upvote 0
Re: How to calulate hours worked on Sundays in a specific month

Hi PCL,

Thank-you for your response.

I used the following formula which worked;

=SUMPRODUCT((TEXT(B16:B46,"ddd")=TEXT(F13,"ddd"))*H16:H46)

Thanks for your willingness to assist a novice like me.

Regards,
Kyle
 
Upvote 0
Re: How to calulate hours worked on Sundays in a specific month

Your example shows incorrect weekdays.
Ensure the formula separators are correct for your region.


Excel 2010
ABCDEFGH
11Week DayPunch DateTime InLunch StartLunch EndTime OutHours Worked
22WednesdayWed 01-Aug-188:0012:0013:0016:007:00
33ThursdayThu 02-Aug-188:0012:0013:0016:007:00
44FridayFri 03-Aug-188:0012:0013:0016:007:00
55SaturdaySat 04-Aug-188:0012:0013:0016:007:00
66SundaySun 05-Aug-188:0012:0013:0016:007:00
77MondayMon 06-Aug-188:0012:0013:0016:007:00
88TuesdayTue 07-Aug-188:0012:0013:0016:007:00
99WednesdayWed 08-Aug-188:0012:0013:0016:007:00
1010ThursdayThu 09-Aug-188:0012:0013:0016:007:00
1111FridayFri 10-Aug-188:0012:0013:0016:007:00
1212SaturdaySat 11-Aug-188:0012:0013:0016:007:00
1313SundaySun 12-Aug-188:0012:0013:0016:007:00
1414MondayMon 13-Aug-188:0012:0013:0016:007:00
1515TuesdayTue 14-Aug-18
1616WednesdayWed 15-Aug-188:0012:0013:0016:007:00
17
18
19Sunday14:00:00
20Sunday14:00:00
2114:00:00
2214:00:00
2314:00:00
24714:00:00
2a
Cell Formulas
RangeFormula
B19=SUMPRODUCT(--(B2:B16="Sunday"),(H2:H16))
B20=SUMPRODUCT(--(B2:B16=A20),(H2:H16))
B21=SUMPRODUCT((WEEKDAY(C2:C16,2)=7)*(MONTH(C2:C16)=8)*(H2:H16))
B22=SUMPRODUCT(--(WEEKDAY(C2:C16,2)=7),--(MONTH(C2:C16)=8),(H2:H16))
B23=SUMPRODUCT(--(WEEKDAY(C2:C16,2)=7),(H2:H16))
B24=SUMPRODUCT(--(WEEKDAY(C3:C18,2)=A24),(H3:H18))
 
Last edited:
Upvote 0
Re: How to calulate hours worked on Sundays in a specific month

Your formula edited


Excel 2010
BCDEF
2514:00:00Sun 05-Aug-18
2614:00:00
2a
Cell Formulas
RangeFormula
B25=SUMPRODUCT(--(TEXT(C2:C16,"ddd")="Sun"),(H2:H16))
B26=SUMPRODUCT(--(TEXT(C2:C16,"ddd")=TEXT(F25,"ddd")),(H2:H16))
 
Upvote 0
Re: How to calulate hours worked on Sundays in a specific month

Thanks Dave,

Your formula is working great. Much appreciated!

Regards,
Kyle
 
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