1

Sorry about my newbieness here.

So... I have this table:

enter image description here

And I want to collect some data into a different sheet:

enter image description here

As example, I am collecting D14, with this formula: =OFFSET(Test_Sheet!$A$18,2,9,1,1).

Problem is: when I drag the formula to Row 15, the value stays the same because the Argument "rows" it is static. How can I drag down this formula with "rows" argument increasing 1 unit per row? Expected result should be =OFFSET(Test_Sheet!$A$18,3,9,1,1).

Thank you all

2
  • You don't need Offset. You could put a direct reference: =Test_Sheet!D14 and drag that down. Commented Apr 29, 2022 at 12:52
  • I did not mention it in my question but I have several small arrays in the same sheet where I need to use this formula. I need to use the OFFSET function (or at least something similar to that) Commented Apr 29, 2022 at 13:04

1 Answer 1

2

Your solution is to create what I call "anchor cells" as references and calculate your offsets from those anchors. In your example, your first anchor is Test_Sheet$A18. For my own convenience, I usually create a named range for that cell.

In my example here, you can see that cell A4 is named DataAnchor.

enter image description here

Your next anchor is the FIRST cell of your formula in relation to the anchor cell. (Clearly, if you move things around your relative "constants" will change. So be advised.)

In this example, my first cell with the formula is F8.

enter image description here

To get the relative row offset between the anchor row and my formula row, you calculate:

ROW()-ROW(DataAnchor)-2

That's the current row number minus the row number of the anchor minus two.

Then the formula in F8 copied down becomes

=OFFSET(DataAnchor,ROW()-ROW(DataAnchor)-2,2,1,1)
Sign up to request clarification or add additional context in comments.

2 Comments

Yes, it is much better but, like you said: "if you move things around your relative "constants" will change". Any tip to overcome this? I might have several "anchors" in the same worksheet where your functions will be implemented.
Honestly? More named anchors or "delta" constants (such as the 2 that's in the formula ROW()-ROW(DataAnchor)-2) can also be turned into another adjustable named value. You can even calculate those values to automagically adjust as needed. This all depends on your data, your arrangement of the data, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.