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

#### KyleOliver

##### New Member
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>
 A B C D E F G H 1 Week Day Punch Date Time In Lunch Start Lunch End Time Out Hours Worked 2 Monday 01 Aug 2018 08:00 12:00 13:00 16:00 7:00 3 Tuesday 02 Aug 2018 08:00​ 12:00​ 13:00​ 16:00​ 7:00​ 4 Wednesday 03 Aug 2018​ 08:00​ 12:00​ 13:00​ 16:00​ 7:00​ 5 Thursday 04 Aug 2018​ 08:00​ 12:00​ 13:00​ 16:00​ 7:00​ 6 Friday 05 Aug 2018​ 08:00​ 12:00​ 13:00​ 16:00​ 7:00​ 7 Saturday 06 Aug 2018​ 08:00​ 12:00​ 13:00​ 16:00​ 7:00​ 8 Sunday 07 Aug 2018​ 08:00​ 12:00​ 13:00​ 16:00​ 7:00​ 9 Monday 08 Aug 2018​ 08:00​ 12:00​ 13:00​ 16:00​ 7:00​ 10 Tuesday 09 Aug 2018​ 08:00​ 12:00​ 13:00​ 16:00​ 7:00​ 11 Wednesday 10 Aug 2018​ 08:00​ 12:00​ 13:00​ 16:00​ 7:00​ 12 Thursday 11 Aug 2018​ 08:00​ 12:00​ 13:00​ 16:00​ 7:00​ 13 Friday 12 Aug 2018​ 08:00​ 12:00​ 13:00​ 16:00​ 7:00​ 14 Saturday 13 Aug 2018​ 08:00​ 12:00​ 13:00​ 16:00​ 7:00​ 15 Sunday 14 Aug 2018​ 16 Monday 15 Aug 2018​ 08:00​ 12:00​ 13:00​ 16:00​ 7:00​

<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?

Regards,
Kyle

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

#### PCL

##### Well-known Member
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:

#### PCL

##### Well-known Member
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

#### KyleOliver

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

Hi PCL,

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

#### Dave Patton

##### Well-known Member

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

Ensure the formula separators are correct for your region.

Last edited:

#### Dave Patton

##### Well-known Member
Re: How to calulate hours worked on Sundays in a specific month

#### KyleOliver

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

Thanks Dave,

Your formula is working great. Much appreciated!

Regards,
Kyle

Replies
3
Views
454
Replies
0
Views
74
Replies
1
Views
450
Replies
2
Views
263
Replies
13
Views
227

1,126,888
Messages
5,621,422
Members
415,839
Latest member
Pollydooner

### 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.

### Which adblocker are you using?

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

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