0

I am using named ranges to create charts dynamically. I take a snapshot every 5 minutes of data and add a new line. The charts update correctly when new data is added.

However, when I clear the first line of data then I get error messages saying

a formula in this worksheet contains one or more invalid references.

I can't do anything because the pop up won't stop coming up. Is there a way to make my formula stronger so it accounts for when the first row is cleared?

My formula:

=OFFSET(Spreads!$B$130,1,0,COUNTA(Spreads!$B$131:$B$1048576),1)

The header starts in cell B130, but the first line of data is in B131. I tried using the Indirect formula, but that didn't seem to help. I am not deleting rows either, I am just clearing the data.

1
  • Does your formula end up looking like this: =OFFSET(Spreads!#REF!,1,0,COUNTA(Spreads!$B$130:$B$1048576),1)? Mar 21, 2017 at 13:36

1 Answer 1

2

Try using INDEX:

=INDEX($B:$B,131):INDEX($B:$B,COUNTA($B$130:$B$1048576)+130)

This returns a reference to the 131st row in column B extended to the 130th+COUNT row in column B. It's also non-volatile unlike OFFSET - They are only recalculated when any of the function's arguments change.

1
  • That fixed it! Awesome, thanks so much for the help!
    – Nknautz
    Mar 21, 2017 at 13:59

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.