+ Reply to Thread
Results 1 to 7 of 7

Sum row until criteria is met (driving me insane!)

  1. #1
    Registered User
    Join Date
    10-17-2012
    Location
    Rugby
    MS-Off Ver
    Excel 2003
    Posts
    5

    Sum row until criteria is met (driving me insane!)

    I have googled and searched for ever on this and all the solutions i have found do not work on my example, so please help.

    C / G / AA / AB / AC / AD / AE /
    buy units / answer / week1 / week2 / week3 / week4 / week5
    10,000 / xxx / 2,000 / 3,000 / 2,000 / 2,000 / 3,000/


    Table above is a very simple example of what i have. I would like a formula that will tell me which week i get to 80% of my buy units total.
    So it needs to sum up until it gets to 8,000 basically then tell me the column reference or week reference or whatever.

    I found a formula that worked if info was in columns not rows.
    I found a formula that worked as long as the answer wasnt required in the same row as the data was.

    I have tried MMULT, MATCH etc etc to no avail so far.

    It is driving me crazy!

    ps sorry for the poor formatting of the example, hope its clear

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Sum row until criteria is met (driving me insane!)

    Mbarnes,

    Welcome to the forum!
    Assumptions:
    Row 1 is a header row so actual data starts in row 2
    The "xxx" entry in cell G2 is where the formula should go

    In cell G2, give this a try:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    10-17-2012
    Location
    Rugby
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Sum row until criteria is met (driving me insane!)

    Sorry yes your assumptions are correct. Will try it at work tomorrow. It looks similar to options I have tried and failed with already so if it works ill be both over the moon and more confused!

  4. #4
    Registered User
    Join Date
    10-17-2012
    Location
    Rugby
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Sum row until criteria is met (driving me insane!)

    It wont let me press enter (or ctrl shift enter) on the formula, it highlights the last "COLUMNS" part as if this is the error.

    its excel 2003 incase that matters

  5. #5
    Registered User
    Join Date
    10-17-2012
    Location
    Rugby
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Sum row until criteria is met (driving me insane!)

    with some tweaking i got this:

    =IF(SUM(AB2:AF2)<(0.8*C2),"Have not reached 80%",INDEX(AB$1:AF$1,MATCH(TRUE,INDEX(SUBTOTAL(9,OFFSET(AB2,,,,COLUMN(INDIRECT("1:"&(AB2:AF2)))))>=(0.8*C2),),0)))

    and ctrl shift enter has it working.
    I will put it into my full sheet rather than my 1 row test sheet but currently you have earned hero status!!!

  6. #6
    Registered User
    Join Date
    10-17-2012
    Location
    Rugby
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Sum row until criteria is met (driving me insane!)

    ok so it works (almost).

    The first week of my array (so AB2) does not have sales units in for every line im looking at. which gives a ref error. I think i need to make the array ranges dynamic. I have another cell that tells me the first week on sale, so will need to use this to start the array, in place of AB2 (and therefore in place of AB1 too).

    What i asked for is solved though, i just need to adapt it slightly to suit.

    Thank you so much

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

    Re: Sum row until criteria is met (driving me insane!)

    @ Mbarnes

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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