+ Reply to Thread
Results 1 to 8 of 8

Counting Values Until Number Reached, Then Returning Cells Counted

Hybrid View

  1. #1
    Registered User
    Join Date
    10-07-2019
    Location
    New York
    MS-Off Ver
    2010
    Posts
    4

    Counting Values Until Number Reached, Then Returning Cells Counted

    Hello,

    I have been unable to locate, or maybe understand, how to construct a function such as this. I have a total list of quantities for items in column "A," and columns from "C" to "S" that count out projected items per day on a day-by-day basis. I would like Excel to start counting from left to right and see how many days it will take to reach the "Ordered Quantity" "A" by adding up the values inside those items-per-day columns. Returning the number of cells it needed to count to get that total value would be fine. Please see the attached document/screenshot for clarification; note that I have already filled in the "Days Worth" column partially manually to demonstrate what I am looking for, and also note that some of the values are rounded, which is why they might seem off (for example row 1 seems like it should be 9 days because of partial quantities). Thank you in advance!

    -ExtraLarge

    Capture.JPG
    Attached Files Attached Files
    Last edited by ExtraLarge; 10-07-2019 at 09:38 AM. Reason: Clarity and additional uploads

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,608

    Re: Counting Values Until Number Reached, Then Returning Cells Counted

    Hi
    you have started this thread in the Outlook forum. Is there a reason why?

  3. #3
    Registered User
    Join Date
    10-07-2019
    Location
    New York
    MS-Off Ver
    2010
    Posts
    4

    Re: Counting Values Until Number Reached, Then Returning Cells Counted

    No, sorry! I am obviously both new and not paying close enough attention; a dangerous combo. I will close and move it. Thank you, and sorry about that!

  4. #4
    Registered User
    Join Date
    10-07-2019
    Location
    New York
    MS-Off Ver
    2010
    Posts
    4

    Re: Counting Values Until Number Reached, Then Returning Cells Counted

    Actually I don't appear to have an option to delete or move it. Is there something I can do or is that only a mod-approved action?

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,608

    Re: Counting Values Until Number Reached, Then Returning Cells Counted

    I'll move it for you, np.
    Perhaps also post a sample sheet instead of a picture so we can work on it ( click Go advanced - Manage attachments)

  6. #6
    Registered User
    Join Date
    10-07-2019
    Location
    New York
    MS-Off Ver
    2010
    Posts
    4

    Re: Counting Values Until Number Reached, Then Returning Cells Counted

    Thank you on both counts, and will do!

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,885

    Re: Counting Values Until Number Reached, Then Returning Cells Counted

    This proposal employs 17 helper columns (U:AK) which may be moved and/or hidden for aesthetic purposes.
    The helper columns are populated using: =ROUND(SUM($C2:C2),0)
    Column B is populated using: =IF(AK2<A2,"N/A",AGGREGATE(14,6,U$1:AK$1/(U2:AK2<A2),1)+1)
    This method matched the manually placed answers except for rows 8:9 (19 is beyond the range of days) and 17 (I believe the formulas are correct).
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  8. #8
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Counting Values Until Number Reached, Then Returning Cells Counted

    Just to see if I could solve this using a macro I had a go at it.

    Your setup is a bit peculiar as the values in range C2:S33 are numbers with decimal not integers. So to compensate for this I use the Round function as well as the condition
    test that the sum value of cells in a row should be equal to or grater than the corresponding value in the A column.

    If that condition is not fulfilled after looping through columns C to S the text "No match" is written in the B column.

    The range setting in the macro is dynamic as it will find the last row with values as well as the last used column so the range can be expanded and the macro will adjust to this.

    To test run macro "NumberOfDays"

    Alf
    Attached Files Attached Files

+ 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. Replies: 4
    Last Post: 12-12-2018, 12:34 AM
  2. COUNTIF where number of cells to be counted varies
    By nicandthat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-27-2017, 04:45 PM
  3. [SOLVED] Counting no. cells in range until first max./min. value is reached
    By zeegerman in forum Excel General
    Replies: 7
    Last Post: 11-30-2016, 11:02 AM
  4. [SOLVED] Counting number of 1s in a row until blank cell is reached.
    By wjhansen in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-23-2013, 08:00 AM
  5. Counting Values Contiguously but duplicates counted as 1
    By akwishestofish in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-04-2013, 10:22 AM
  6. Replies: 2
    Last Post: 06-23-2009, 05:38 PM
  7. [SOLVED] [SOLVED] Counting blank cells until value is reached
    By Dan in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-01-2006, 09:00 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