Results 1 to 8 of 8

Using a variable number of cells in SUM function

Threaded View

  1. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,102

    Re: Using a variable number of cells in SUM function

    Cell D2:
    Formula: copy to clipboard
    =IF($B2<>"","",SUM(INDEX($B:$B,ROW($A2)+1):INDEX($B:$B,ROW($A2)+$C2)))
    and copy down.

    Or

    Cell D2:
    Formula: copy to clipboard
    =IF(ISNUMBER($C2),SUM(INDEX($B:$B,ROW($A2)+1):INDEX($B:$B,ROW($A2)+$C2)),"")


    Variations on a theme depending on your data structure.



    See the updated example attached
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] using Countif Function: Column number stored in a variable
    By vidyuthrajesh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2014, 06:58 PM
  2. Summing a variable number of cells
    By rschammel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-30-2013, 02:55 AM
  3. Averaging Variable Number of Cells
    By MaxM&M in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-26-2013, 09:01 PM
  4. Sum a variable number of cells
    By lhmome in forum Excel General
    Replies: 11
    Last Post: 05-02-2009, 02:31 AM
  5. [SOLVED] Hyperlink function fails when using variable row number
    By Balex in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-08-2006, 01:45 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