Results 1 to 3 of 3

Count of rows in range sum until target is met, preferably working from the bottom up

Threaded View

  1. #1
    Registered User
    Join Date
    01-25-2012
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    17

    Count of rows in range sum until target is met, preferably working from the bottom up

    I'm trying to sum a range of cells to reach a certain target. Once that target is met, I need to know the number of rows it took to reach that target value and retrieve the value from an adjacent cell.
    In this example I need to sum up rows of apples&bananas to get a total fruit count. Once that fruit count reaches a target (40) I need to know the #rows it took to get there and what the associated color is from the adjacent cell.

    Ideally I would start at a particular bottom cell and work my way up until the sum reached the target. This seems to really complicate things but it's how my data source is structured.
    If it's way too complicated to do it bottom-up, then I can work with a developer to get the dataset flip-flopped so that I can work with it top-down.

    I've seen a few example formulas that are close but they always deal with summing up a single column and I've been unable to adjust it properly to make it a range-based sum. I'm also not 100% sure how to convert these into something that would produce the associated color.

    excel.range.sum.until.target2.jpg

    Here are the examples I've found while searching that get me part-of-the-way to where I need to be (*Note these only work top-down):
    =SUM(OFFSET(A2,0,0,MAX(INDEX((SUBTOTAL(9,OFFSET(A2,0,0,ROW(1:99999),1))<F1)*ROW(1:99999),,))+1,1))
    =MAX(INDEX((SUBTOTAL(9,OFFSET(A2,0,0,ROW(1:99999),1))<F1)*ROW(1:99999),,))+1
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Count the number of cell rows address from top to bottom?
    By rayhen in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-16-2020, 02:10 AM
  2. [SOLVED] Target.Adress not working when pasting a range over a column that is tracked for changes
    By Beginer25 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-20-2019, 11:06 AM
  3. [SOLVED] Return Row no. for Lookup from bottom of range, ignoring bottom n no. of rows
    By naira in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 12-27-2018, 12:07 AM
  4. Lookup from bottom of range, ignoring bottom n no. of rows
    By naira in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-05-2018, 04:26 AM
  5. [SOLVED] Hide rows IF #N/A (preferably without marco)
    By The excel apprentice in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-04-2016, 09:40 AM
  6. Private Sub Worksheet_Change(ByVal Target As Range) not working
    By kaseyleigh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-05-2013, 07:12 AM
  7. putting count of the number of rows at the bottom
    By lpdarspe in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-21-2006, 07:55 AM

Tags for this Thread

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