Results 1 to 3 of 3

Thread: How to sum a variable part of a range

  1. #1

    How to sum a variable part of a range



    Register for a FREE account, and/
    or Log in to avoid these ads!

    I would like to compute the sum of a variable contiguous part of the range R(1:1000) where say cells A1 and A2 contain the integers indicating the first and the last cell of the selected part respectively. For instant is A1 contains 7 and A2 contains 120 how can I compute SUM(R7:R120)? Thanks for the help.

  2. #2
    Super Moderator Zack Barresse's Avatar
    Join Date
    Mar 2011
    Location
    Oregon, United States
    Posts
    106
    Articles
    0
    Hi there,

    You want he INDIRECT() function, like this...
    Code:
    =SUM(INDIRECT("R"&A1&":R"&A2))
    HTH
    Regards,
    Zack Barresse

  3. #3
    Super Moderator Pecoflyer's Avatar
    Join Date
    Oct 2011
    Location
    Brussels Belgium
    Posts
    1,467
    Articles
    0
    Excel Version
    2010 on Xubuntu
    If you want to avoid the volatile INDIRECT also try
    Code:
    =SUM(INDEX($R$1:$R$1000,A1):INDEX($$R1:$R$1000,A2))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •