+ Reply to Thread
Results 1 to 10 of 10

Function to Sum a number of rows based on a variable

Hybrid View

  1. #1
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Function to Sum a number of rows based on a variable

    Maybe something like this...

    Data Range
    A
    B
    C
    D
    1
    Data
    -----
    Number of cells
    Sum
    2
    1
    5
    5
    3
    1
    4
    1
    5
    1
    6
    1
    7
    1
    8
    1
    9
    1
    10
    1
    11
    1


    This formula entered in D2:

    =SUM(A2:INDEX(A2:A11,C2))

    If C2 is an empty cell the formula will sum the entire range.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  2. #2
    Registered User
    Join Date
    06-23-2014
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    5

    Re: Function to Sum a number of rows based on a variable

    Quote Originally Posted by Tony Valko View Post
    Maybe something like this...

    Data Range
    A
    B
    C
    D
    1
    Data
    -----
    Number of cells
    Sum
    2
    1
    5
    5
    3
    1
    4
    1
    5
    1
    6
    1
    7
    1
    8
    1
    9
    1
    10
    1
    11
    1


    This formula entered in D2:

    =SUM(A2:INDEX(A2:A11,C2))

    If C2 is an empty cell the formula will sum the entire range.

    Yes, this is what I was looking for! it seems to be working. Thank you and @FDibbins very much for the help. Reps

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Function to Sum a number of rows based on a variable

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Basic Macro needed
    By alanbenjy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-02-2010, 07:31 AM
  2. basic formula help needed
    By Malchemist in forum Excel General
    Replies: 2
    Last Post: 05-31-2010, 06:49 AM
  3. Basic IF function help needed
    By EME in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-29-2009, 05:51 AM
  4. Help needed learning basic excel vba
    By excelkeechak in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-26-2009, 04:27 AM
  5. Basic Excel Question - Help Needed
    By PepsiCo85 in forum Excel General
    Replies: 3
    Last Post: 07-23-2007, 09:01 AM

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