Reputation: 663
I have the following table that calculates the total hours worked each day
Total (real)
= End (real)
- LUNCH
- START
I need to calculate the number of hours worked so far only in the current week. I have tried SUMIFS()
to compare the weeknum and year of the data to only sum data from the current week. I am saving this to a cell off the screenshot.
This is the jist of what I would like to achieve. I recognize the syntax is off:
=SUMIFS(G:G,A:A,WEEKNUM(A:A)==WEEKNUM(TODAY()),year(A:A)==year(today()))
Where is my syntax heading off track?
Note - Not using a pivot table for this application. So I need this to be formula-based.
Upvotes: 0
Views: 1079
Reputation: 152450
Use this that finds the date of Sunday before and Saturday after and uses them as brackets:
=SUMIFS(G:G,A:A,">=" & INT((TODAY()-1)/7)*7+1,A:A,"<" & INT((TODAY()-1)/7)*7+8)
Upvotes: 2