1
votes

In Google Sheets, I'm trying to add up the hours (column F) for each week and automatically select the correct date range (Monday to Sunday). The start date may be in the middle of a week, and I want it to end the Sunday after the start date, then repeat the cycle until it's not populated. For example, Week1 is from Thursday to Sunday, and the following Monday to Sunday needs to Week2, etc.

Image

If this is a duplicate I apologize; I couldn't find anything that answered it.

Example file

1
sheet is private - player0
Updated the link, sorry. I didn't realize it was private. - Jakar510

1 Answers

1
votes

try:

=ARRAYFORMULA(QUERY({WEEKNUM(A2:A22, 2), F2:F22}, 
 "select sum(Col2) 
  where Col2 is not null
  group by Col1 
  label sum(Col2)''"))

0