0

I have an excel formula =SUM(AZ2:AZ300)

I want to make this more dynamic by using the formula =ROW(OFFSET($B$1,COUNTA($B:$B)-1,0)) in cell A1

Then I want my formula to do the following =SUM(AZ2:AZ&A1) This formula doesn't work, but it to take the sum of cells AZ2 through AZ and the number given in cell A1

For example if A1 value is 250 then I want the formula to be equivalent to =SUM(AZ2:AZ250)

Thanks in advance for your help.

0

1 Answer 1

2

Rather than putting the row number in a separate cell you could combine it in the formula:
=SUM($A$2:INDEX($A:$A,COUNTA($B:$B)-1))

This does the same as the OFFSET version, with the bonus of not being volatile.

Sign up to request clarification or add additional context in comments.

Comments

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.