+ Reply to Thread
Results 1 to 4 of 4

Defining a range for SUM based on a variable value in another cell

  1. #1
    Registered User
    Join Date
    08-11-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Defining a range for SUM based on a variable value in another cell

    I have explored tons of forums and have found similar situations but no solution.

    I have a function in AB3 that counts units sold. Then in cell AB5, I am trying to incorporate a SUM function that only SUMS as many cells as the value that is in AB3.

    Example, I sell 107 units in January, I want to SUM the values in Z2:Z108. If I sell 10 units in December then I want to SUM the values in Z2:Z11.

    The last formula that I used was =SUM(OFFSET(Z2:Z999,AB3,0)) but it returned the wrong SUM. I can't tell exactly what it's grabbing. I assume I've used this formula incorrectly.

    Please help!

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Defining a range for SUM based on a variable value in another cell

    Hi,

    =SUM(Z2:INDEX(Z:Z,AB3+1))

    Regards
    Last edited by XOR LX; 02-04-2014 at 03:33 PM.
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    08-11-2012
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Defining a range for SUM based on a variable value in another cell

    That worked perfect. Thanks!

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Defining a range for SUM based on a variable value in another cell

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] defining a cell based on a range
    By HarryKlein in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-25-2013, 04:56 AM
  2. [SOLVED] Defining Data Range Based on Cell Value
    By mattmc419 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-21-2013, 05:29 AM
  3. Defining a Range Value with a Variable
    By elgourmet in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2010, 03:09 AM
  4. Defining a Range using a variable
    By FredBloggs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-09-2007, 04:50 PM
  5. Defining cell range as a variable
    By jay567 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2005, 07:08 PM

Tags for this Thread

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