Google-sheets – Sum range of month by quarters

google sheets

I'm importing a range from another spreadsheet using =IMPORTRANGE() which results in the following:

enter image description here

I need to sum() for groups of three month (every quarter), i.e., sum Jan, Feb, Mar in column 1, Apr, May, Jun in column 2, and so on…

How do I accomplish this in Google Sheets?

Best Answer

Assuming your data starts at col A and row 5 and extends to row 7 paste the below formula in column A and drag and autofill the formula across in the same row.

=sum(INDEX(transpose($A$5:$L$7),(column()-1)*3+1))+sum(INDEX(transpose($A$5:$L$7),(column()-1)*3+2))+sum(INDEX(transpose($A$5:$L$7),(column()-1)*3+3))

If your starting column is different from 1(Col A) then change the offset to the column number you are starting the formula at. So for column D you modify the below from

column()-1

to this

column()-4

The ways this works is to transpose the data array and select one column at a time using index, to be summed. The (column()-1)*3+1,2,3 generates index for next three columns to be summed.