+ Reply to Thread
Results 1 to 7 of 7

Count of cells that can be summed before a value is reached or exceeded?

  1. #1
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Count of cells that can be summed before a value is reached or exceeded?

    Wondering if there is a way to do this without using macros...

    I have a table of values listed where columns are dates (earliest on the left) and rows contain values. I am looking for a formula to return the number of values, counted left to right, it would take on a given row it would take to meet another value....awkward explanation;

    comma delimited example here, i cannot upload files sorry. Copy paste and text-to-col starting in cell A1

    Please Login or Register  to view this content.
    Column B shows where the formula would be. The number represents how many cells (counted from left to right) in range D:G can be summed before the value in column A is reached or exceeded. Oh also it needs to skip blanks (values in columns C and D can be blank with values starting in E)

    Thanks in advance!
    Last edited by Speshul; 05-29-2013 at 03:36 PM. Reason: Solved

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Count of cells that can be summed before a value is reached or exceeded?

    Any help on this?

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Count of cells that can be summed before a value is reached or exceeded?

    Does this work for you?

    =IF(MATCH(A2,$C2:$G2)=5, MATCH(MAX($C2:$G2), $C2:$G2,0),MATCH(A2,$C2:$G2))
    5 is the number of columns/numbers
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

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

  4. #4
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Count of cells that can be summed before a value is reached or exceeded?

    alllmost... but it still continues to count after the limit is exceeded if the value matches (put 100 in Column A and 100 in columns C D E F, it will show a 4 when really it should be 1)

    Thanks for responding though

  5. #5
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Count of cells that can be summed before a value is reached or exceeded?

    Heres an example to help put this in context, Think of A as a sales goal in dollars, and C, D, E, F, G as projected sales by week. The formula will tell me in how many weeks will the goal be met or exceeded. (But some weeks will be blank, and must be skipped)

  6. #6
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Count of cells that can be summed before a value is reached or exceeded?

    if you are fine with the formula returning a value from 1st row (in case of your data, Date 1 through 5), then try this ARRAY formula in H2, then drag-fill down:

    Please Login or Register  to view this content.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  7. #7
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Count of cells that can be summed before a value is reached or exceeded?

    perfect, I added a hidden row under the header column and just hlookup'd the return of your formula to get my numbers

    Thank you!

+ 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