+ Reply to Thread
Results 1 to 6 of 6

Keep running if statement until desired value reached

  1. #1
    Registered User
    Join Date
    04-23-2017
    Location
    australia
    MS-Off Ver
    Mac
    Posts
    3

    Talking Keep running if statement until desired value reached

    Hey Guys and Girls!
    We are trying to run a formula to help us with reordering our stock.

    we have set the order rate at 7.53, which is the average amount of time we would usually take to order from this supplier. We have also we the average days it takes to order this specific product.

    so we ran an if statement which works fine when the stock rate is more then the reorder rate, as it returns value of 1. We then order 1 item.
    But I need the if statement to keep adding up until it reaches the order rate, so we know how many to order when then frequency of order is less than the average reorder.

    Average Reorder Frequency 7.53
    Frequency of order for this product 4

    so we should order a box every 4 days, but our average reorder frequency is 7.53 days, so in affect we would order 2 boxes almost every week until we reach max, then we would order 1, because or stock of that product wont run out before next order
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Keep running if statement until desired value reached

    So my suggestion for weekly order is in G6:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and copy down.
    Most weeks you order 2 boxes of gloves but roughly every 9th week only one box.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    04-23-2017
    Location
    australia
    MS-Off Ver
    Mac
    Posts
    3

    Re: Keep running if statement until desired value reached

    Thanks for this, are you able to expalin how this works for me ?

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Keep running if statement until desired value reached

    first week (G6) you order 2 boxes. 2*4 = 8 which covers your requirement of 7.53
    second week again 2 boxes, because you need 2*7.53 - 8 ordered first week
    third week 3*7.53 -16 etc.
    so as you copy formula down row (a1)=1 changes into row(A2)=2, etc
    part: 7.53*row(a1) represents accumulated needs till current week
    the sum of all above multiplied by 4 is total number ordered so far
    the difference between two above is current need, and it is rounded up to nearest 4 (as you cannot order 3/4 of box) and it is the number of needed gloves
    then it is divided by 4 to get number of boxes needed.

  5. #5
    Registered User
    Join Date
    04-23-2017
    Location
    australia
    MS-Off Ver
    Mac
    Posts
    3
    Quote Originally Posted by Kaper View Post
    first week (G6) you order 2 boxes. 2*4 = 8 which covers your requirement of 7.53
    second week again 2 boxes, because you need 2*7.53 - 8 ordered first week
    third week 3*7.53 -16 etc.
    so as you copy formula down row (a1)=1 changes into row(A2)=2, etc
    part: 7.53*row(a1) represents accumulated needs till current week
    the sum of all above multiplied by 4 is total number ordered so far
    the difference between two above is current need, and it is rounded up to nearest 4 (as you cannot order 3/4 of box) and it is the number of needed gloves
    then it is divided by 4 to get number of boxes needed.
    Thanks for this, it's all make sense and looks good. Only missing requirement is if we order out of sequence. Ie I have how many days since last order. This is so I could take into account public holidays

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Keep running if statement until desired value reached

    To achieve this you shall probably totally change layout of your sheet
    And include dates, used and ordered quantities,
    You shall also take into account your minimal acceptable stock reserve, expected delay between order and delivery, etc.


    Or at least indicate where the information about these holidays, and other special events is written in a sheet

+ 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. [SOLVED] Move specific cells to a new sheet when a date is reached or 30 days from being reached
    By Albert Dirk in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-26-2016, 04:44 AM
  2. [SOLVED] VBA Step Into works as desired but running macro doesn't
    By smit.etha in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2015, 07:47 PM
  3. [SOLVED] Need A running total until a certain number is reached
    By jeck876 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-01-2015, 12:40 PM
  4. Stop running macro when time value in a cell reached or exceed
    By bezbid in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-26-2015, 08:23 PM
  5. Select desired active cell after running the Macro
    By graiggoriz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2013, 07:38 AM
  6. Rolling subtraction of multiple cells in row until desired total reached
    By ducexcel2 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-22-2013, 10:29 AM
  7. Replies: 2
    Last Post: 08-01-2013, 04:49 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