+ Reply to Thread
Results 1 to 7 of 7

applying formulas using cell references

  1. #1
    Registered User
    Join Date
    12-16-2009
    Location
    Tennessee, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    applying formulas using cell references

    Hi - I'm new here. I've looked over a few pages of posts but didn't find a topic I thought would address what I would like to do.

    Suppose I have the numbers 1-10 in cells A1-A10 respectively

    suppose in cell A12 I have a value x and in cell A13 I have a value y.

    I would like to put a formula in cell A15 that sums up the values in cells Ax to Ay. For example, if the value in cell A12 is 4 and the value in cell A13 is 6, the result of the formula in cell A15 would be the sum of A4,A5,A6 = 15.

    I have had no luck coming up with a formula that does this, or in searching for a formula that does this. A little help, please?

    Thanks,
    Peter
    Last edited by NBVC; 12-19-2009 at 10:33 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: applying formulas using cell references

    one way
    =SUM(INDIRECT(ADDRESS(A12,1)&":"&ADDRESS(A13,1)))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: applying formulas using cell references

    Use a combination of the SUM and INDIRECT functions

    The formula in A15 would be:

    =SUM(INDIRECT("A"&A12&":A"&A13))

  4. #4
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191

    Re: applying formulas using cell references

    If the numbers are literally 1:10, or just consecutive integers, you can use =A13/2*(A13+1)-(A12-1)/2*A12 and not even really need the list.
    Otherwise, I'd opt for the non-volatile Index function: =SUM(Index(A1:A10,A12):Index(A1:A10,A13))

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: applying formulas using cell references

    Try:

    =Sum(Index(A1:A10,A12):Index(A1:A10,A13)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: applying formulas using cell references

    cutters is neater i went for overkill! then again NBVC is the best option as it doesnt involve indirect at all.
    but it needs another )
    =SUM(INDEX(A1:A10,A12):INDEX(A1:A10,A13))
    Last edited by NBVC; 12-18-2009 at 05:24 PM. Reason: corrected name spelling

  7. #7
    Registered User
    Join Date
    12-16-2009
    Location
    Tennessee, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: applying formulas using cell references

    Thank you all for the replies. They have done the trick (I implemented the last one) and by playing with each of them, I actually got to learn something (who knew, right?). Sincerely - thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1