+ Reply to Thread
Results 1 to 9 of 9

Replacing OFFSET to sum up to max value from specific cell

  1. #1
    Registered User
    Join Date
    02-25-2022
    Location
    CA
    MS-Off Ver
    365
    Posts
    4

    Replacing OFFSET to sum up to max value from specific cell

    Hello everyone, I am new to the board & thank you all in advance for the help.

    I have data for the time it takes each step in a manufacturing process & each step has a unique name that never repeats, see attached sample.

    What I want to accomplish is have (2) inputs that I can change independently, which are, which step am I starting on (Start Point) & MAX time I have available, then return the total time up to that cell (Sum of Steps) without exceeding the max time & how many steps were completed (Count).

    For example, as seen on table above, lets say I will be starting at "2800N3" (located in A4) & I only have 20 minutes (my given Max Time), & I want to know how many steps I will be able to complete in those 20 minutes and what is the actual total time (sum) up to that last completed step. In this case, with 20 minutes, I will complete steps 2800N3 & 2800N4, and the sum of those completed steps is 14, and the number of steps completed was 2.

    Another example, Start Point: 2800N2, Max Time: 30, RESULTS: Sum of Steps: 22 & Count: 3, ie with 30 minutes we can complete 2800N2 thru 2800N4, which is 3 steps.

    I was able to get this to work using a combination of match, index, subtotal and offset, however offset is a volatile function, and since I will have about 30 of these in the same cell (one for each mfg machine) it becomes really slow when changing values, so I would like to use something that in non-volatile in hopes the calculations are faster.
    Attached Files Attached Files
    Last edited by mfeengineer; 02-25-2022 at 02:14 PM. Reason: Attached sample sheet

  2. #2
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2404
    Posts
    1,250

    Re: Replacing OFFSET to sum up to max value from specific cell

    Welcome to the forum.

    I created a helper column with this formula, say in H2, copied down:
    =IF(COUNTIF(A$2:A2,$C$2),B2+H1,0)

    Then this non-volatile formula to total time:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And this to count steps:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Please run some test in attached file and let us know how it goes.

    Good luck!
    Attached Files Attached Files
    Last edited by Estevaoba; 02-25-2022 at 04:05 PM.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,493

    Re: Replacing OFFSET to sum up to max value from specific cell

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As you are new here, I will do it fir you this time: https://www.mrexcel.com/board/thread...-cell.1197398/)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    02-25-2022
    Location
    CA
    MS-Off Ver
    365
    Posts
    4

    Re: Replacing OFFSET to sum up to max value from specific cell

    WORKS PERFECTLY!

    Thank you.

  5. #5
    Registered User
    Join Date
    02-25-2022
    Location
    CA
    MS-Off Ver
    365
    Posts
    4

    Re: Replacing OFFSET to sum up to max value from specific cell

    Thank you, my apologies.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Replacing OFFSET to sum up to max value from specific cell

    , and since I will have about 30 of these in the same cell (
    With that thought in mind I will surmise that number could be variable, and with that thought in mind I propose using a dynamic named range (DNR) as opposed to cell address ranges. If you are not familiar with DNRs they resize to fit your data automatically. One is defined and stored in Name Manager.

    It is also a way to do this without helper columns. Please find this listed in the attached and in Name Manager.


    Time_Rnge
    =INDEX(Sheet1!$B:$B,MATCH(Sheet1!$C$2,Sheet1!$A:$A,0)):INDEX(Sheet1!$B:$B,MATCH(25^25,Sheet1!$B:$B))


    Then this formula in D3
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and this one in E3
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  7. #7
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2404
    Posts
    1,250

    Re: Replacing OFFSET to sum up to max value from specific cell

    You’re welcome. Glad to help.
    Thank you for the feedback and for the reputation added.
    Have a blessed day.

  8. #8
    Registered User
    Join Date
    02-25-2022
    Location
    CA
    MS-Off Ver
    365
    Posts
    4

    Re: Replacing OFFSET to sum up to max value from specific cell

    Ok so I prematurely checked off this as solved.

    So now I have a new problem, using Estevaoba's formulas it creates issues with the calculations because I am putting multiple iterations of my sample within the same sheet.

    FlameRetired, I tried your method as will be have the same issues, as a kicker I don't fully understand DNR but don't oppose it if it works.

    I have added the actual sheet I am working with, using Estevaoba's formula's, in hope it is just a simple tweak of the formula, named Test 2.

    Also added my original with using offset formula, named OFFSET-Version, as a single iteration so the calculations wouldn't be slow in case it triggers a different way of doing it. FYI, the A7, Total N-Blocks, is the formula that is using the OFFSET function.

    Thanks again.
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,535

    Re: Replacing OFFSET to sum up to max value from specific cell

    Not sure that this will speed up the process, however the formulas do not employ the OFFSET function nor are they array entered.
    Column F on the Data sheet is populated using: =SUMIFS(D$2:D2,B$2:B2,B2)
    On the Leads sheet in columns B, D, F and H:
    1. Row 6 is populated using: =MATCH(B5,Data!$E2:$E60,0)
    2. Row 7, which displays the number of rows to be summed, is populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    3. Row 8 is populated using: =INDEX(Data!$C2:$C60,SUM(B6:B7)-1)
    4. Row 9 is populated using: =SUM(INDEX(Data!$D2:$D60,B6):INDEX(Data!$D2:$D60,SUM(B6:B7)-1))
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Offset The Column Dictionary is Replacing Value in.
    By Vlad717 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2019, 06:30 PM
  2. [SOLVED] Replacing offset with non-volatile functions
    By beth6891 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-19-2016, 10:49 AM
  3. Replacing specific text in cell
    By SSB in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2012, 01:57 PM
  4. Replies: 2
    Last Post: 01-12-2012, 01:25 AM
  5. Offset for specific cell range(s)
    By km5558 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-21-2008, 02:43 AM
  6. Replacing Specific part in a cell
    By sjanaswamy in forum Excel General
    Replies: 1
    Last Post: 08-23-2006, 04:26 PM
  7. Replies: 5
    Last Post: 05-03-2005, 04:06 PM

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