Thread: Nested Funtions
View Single Post
  #8   Report Post  
StephanieH
 
Posts: n/a
Default

Oh I see what you're saying. In this case, the starting point is always the
same row, but our range moves up a row for each column to the right. It
makes it easy to move through the cells and make sure they're following the
logic. But, your point is good to know in cases where it makes more sense to
see where the top of the range is instead. I'll keep it in mind.

Thanks Harlan.



"Harlan Grove" wrote:

StephanieH wrote...
I'm not sure I understand the advantage to
OFFSET(rng,ro+rc-SIGN(rc),co+cc-SIGN(cc),-rc,-cc)


Your original formula used function calls like

OFFSET($B18,-4,0,-6,1)

The arguments are hardcoded, so there should be no big deal changing
them to

OFFSET($B18,-9,0,6,1)

The advantage of this for future maintainers is that the 1st, 2nd and
3rd arguments alone establish the starting (top-left) cell, and the 4th
and 5th arguments only determine the size of the range. Using negative
4th or 5th arguments, all arguments are needed to determine the
starting (top-left) cell.

The ending (bottom-right) cell of the range produced by both of these
function calls is B14. That is easier to figure from your function
call. So I guess it's a question of whether one prefers it to be easier
to figure out the top-left or bottom-right cell in a dynamic range, and
that's subjective.

We add a row above the formulas each month and insert more data. The offset
takes care of the adjustments were were making each month because of the
inserted row. Since we no longer make adjustments, how would eliminating the
negative help me?


Aside from the 1st, the arguments in your OFFSET calls are constants.
If you're inserting rows on or above row 18, only the 1st argument
would be adjusted by the row insertion. So if you insert 2 rows above
row 18, your function call above would become

OFFSET($B20,-4,0,-6,1)

which would return B11:B16. On the other hand, my formula would become

OFFSET($B20,-9,0,6,1)

which would also return B11:B16.

It's all a question of whether it should be easier to figure out the
top-left or bottom-right cell in the range. For me, it's usually better
to be able to figure out the top-left cell, but I'll admit that could
be subjective.