+ Reply to Thread
Results 1 to 4 of 4

Sum a Running String of Cells based on Values in Another Column

Hybrid View

  1. #1
    Registered User
    Join Date
    10-07-2019
    Location
    Manitoba, Canada
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    32

    Sum a Running String of Cells based on Values in Another Column

    Oof even wording a title was difficult let alone google this.

    The cost in column F is ever increasing after the first 5.

    The amount needed each time varies.

    I need a formula that will take the value in A2 (9) and sum the first 9 values in column F. That same formula would then take the value in A3 (3) and sum the next 3 values in Column F. Next one would be A3 (7) the formula would count the cost of 13-19 which equals 9100

    The color is just for this post for visual effect of what i'm pointing out and how they are relating to each other.

    This feels like a COUNT/COUNTIF/SUMIF nested formula but i just can't wrap my head around the order. Thanks for your help.

    *Sorry about the image size...don't know how to resize it as an attachment...

    2021-04-01 16_57_17-Book1 - Excel.png
    Attached Images Attached Images

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Sum a Running String of Cells based on Values in Another Column

    You can use this formula in B2:

    =SUM(F2:INDEX(F:F,A2+1))

    and this one in B3:

    =SUM(INDEX(F:F,SUM(A$2:A2,2)):INDEX(F:F,SUM(A$2:A3)+1))

    You can copy the formula from B3 into B4.

    Hope this helps.

    Pete

    P.S. Next time, don't bother showing a picture of a worksheet (which we can't work with) - instead, attach a sample workbook by following the guidance in the yellow banner at the top of the screen.

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,179

    Re: Sum a Running String of Cells based on Values in Another Column

    Or try this in B2:

    =SUMIFS(F:F,E:E,">"&SUM($A$1:A1),E:E,"<="&SUM($A$1:A2))

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,179

    Re: Sum a Running String of Cells based on Values in Another Column

    Another way:

    =SUM(OFFSET($F$2,SUM($A$1:A1),0,A2,1))

+ 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. Using a macro to create a string in a cell based on corresponding column values
    By onigami in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2018, 12:39 AM
  2. [SOLVED] Creating text string based on column titles and values below
    By h2whoa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-19-2016, 06:17 AM
  3. [SOLVED] Filled max and min values in running column cells
    By thilag in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-30-2015, 01:51 AM
  4. Running Macro with Do Loop of similar based on values in a Column
    By fishycarl in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-11-2013, 03:50 AM
  5. chart x/y values based upon string match in another column
    By tedmc54 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 01-19-2013, 04:03 AM
  6. [SOLVED] macro which copies all column values based on specific string inputs
    By buntalan80 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-12-2012, 03:08 PM
  7. adding values as 1 string, based on adjacent column
    By TCountryman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2010, 10:51 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