SOLVED

Range changing in increments

Copper Contributor
I need some help. I’m summarising data from one sheet into another, the amount of data points is in the thousands. In my summary sheet I’m summarising around 250 data rows into one row on a seperate sheet and when I drag it down the column to summarise the next range, it doesn’t follow it. For example I want to summarise data from B2:B138, such as SUM(B2:B138). When I go down a column the formula then changes to be SUM(B3:B139) rather then being SUM(B139:B275) where the ranges changes by the whole 137 points. I don’t want to re type it as I have a good 50 of these to do. I’m sorry if it’s hard to understand I’m new to excel and suck as explaining it, but for anyone who gets what I’m trying to say, any help would be amazing
5 Replies
best response confirmed by Tbear_beardsley (Copper Contributor)
Solution

@Tbear_beardsley 

Let's say the formula =SUM(DataSheet!B2:B138) is in cell D2 of the summary sheet.

Change it to

 

=SUM(OFFSET(DataSheet!$B$2:$B$138, 137*(ROW()-2), 0))

 

or

 

=SUM(INDEX(DataSheet!B:B,137*(ROW()-2)+2):INDEX(DataSheet!B:B,137*(ROW()-2)+138))

 

Then fill down.

Perfect. Can you explain the row situation. And would it be similar if I wanted to do the same along the columns for data going across?
Never mind found out I just have to take the $ off the B but leave it on the number

@Tbear_beardsley 

Great!

 

ROW() returns the row number of the cell with the formula. So for a cell in row 2, ROW() returns 2.

ROW()-2 returns 0 in row 2, 1 in row 3 etc.

137*(ROW()-2) returns 0 in row 2, 137 in row  3, etc.

OFFSET(DataSheet!B$2:B$138, 137*(ROW()-2), 0) is equivalent to B$2:B$138 in row 2, but to B$139:B$275 (that is, 137 rows down from B$2:B$137) in row 3, etc.

@Tbear_beardsley 

You didn't state what version of Excel you use so I held back because all my work is specific to Excel 365 and sometime beta channel only.  It is macro-enabled because it contains VBA utility to upload Lambda functions which are of interest to me but not generally usable.  The LET functions work with most Excel 365 installations.

The formula that is most likely to be usable is

= LET(
  array,  INDEX(data, SEQUENCE(10,Blocksize)),
  vector, SEQUENCE(Blocksize,,,0),
  MMULT(array, vector))

and least likely

= SUMROWSλ(
      PIVOTλ(data, blocksize)
   )
1 best response

Accepted Solutions
best response confirmed by Tbear_beardsley (Copper Contributor)
Solution

@Tbear_beardsley 

Let's say the formula =SUM(DataSheet!B2:B138) is in cell D2 of the summary sheet.

Change it to

 

=SUM(OFFSET(DataSheet!$B$2:$B$138, 137*(ROW()-2), 0))

 

or

 

=SUM(INDEX(DataSheet!B:B,137*(ROW()-2)+2):INDEX(DataSheet!B:B,137*(ROW()-2)+138))

 

Then fill down.

View solution in original post