Search code examples
google-sheetsgoogle-sheets-formula

Finding a sum of cells given address range in google sheets


I need a google sheet formula

Click here to make a copy of sheet

I have a data in table from B column to H column Data runs from left to right only in B through H Given a starting address of the cell and given a ending address of the cell (in the image you see H1 and H2 columns)

I want to find the sum of all cells from the start to end address with respect from B through H

When yellow value dates are changed the sum should be reflected accordingly.

enter image description here

My results are incorrect since it needs to find the sum spanning the cells from B to H column

I have tried with

=SUM(INDIRECT(H1&":"&H2))

Solution

  • Try

    =let(cols,tocol(B5:H,1),start,(D1-1)*7+F1,end,(D2-1)*7+F2,sum(chooserows(cols,sequence(end-start+1,1,start))))
    

    enter image description here