+ Reply to Thread
Results 1 to 11 of 11

Create daily running total that subtracts from previous days when necessary

  1. #1
    Registered User
    Join Date
    06-28-2016
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    7

    Create daily running total that subtracts from previous days when necessary

    I have a file that contains a row of values for production and another row for orders.
    I need a third row that will subtract orders from production, creating a list of available inventory. The available inventory row should be a running total, by day, that subtracts from current and previous days inventory when necessary.

    Please help with the formula I would need to put in the available column that only subtracts from previous days when necessary, but still shows negative if the orders column is greater than the running total of the production column.

    Example:
    Capture.JPG
    Last edited by alijo; 06-28-2016 at 09:16 PM. Reason: clarification of question

  2. #2
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Create daily running total that subtracts from previous days when necessary

    In C6 have =C4-C5
    In D6 have =C6+D4-D5. This formula can then be copied across row 6 to the other columns.
    Please add reputation by clicking on the * if I have helped.
    Please mark the thread SOLVED if your issue has been resolved.
    Thanks, Glenn.

  3. #3
    Registered User
    Join Date
    06-28-2016
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Create daily running total that subtracts from previous days when necessary

    Quote Originally Posted by gak67 View Post
    In C6 have =C4-C5
    In D6 have =C6+D4-D5. This formula can then be copied across row 6 to the other columns.
    The problem with that is it doesn't adjust the available inventory for previous days to reflect that it is no longer available. I need some sort of if statement that will adjust C6 and D6 to also reflect 0 available because the inventory that was previously available for Monday and Tuesday has now been sold (on Wednesday).

    Capture.JPG
    Last edited by alijo; 06-28-2016 at 09:27 PM. Reason: added image

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Create daily running total that subtracts from previous days when necessary

    Try this in C6:

    =SUM($C$4:C4)-SUM($C$5:C5)

  5. #5
    Registered User
    Join Date
    06-28-2016
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Create daily running total that subtracts from previous days when necessary

    Quote Originally Posted by Phuocam View Post
    Try this in C6:

    =SUM($C$4:C4)-SUM($C$5:C5)
    That gives me the same totals as the image above.
    The formula will need to be more complex, including something about if production minus orders on future days is negative, also subtract from earlier production

  6. #6
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167
    Quote Originally Posted by alijo View Post
    The problem with that is it doesn't adjust the available inventory for previous days to reflect that it is no longer available. I need some sort of if statement that will adjust C6 and D6 to also reflect 0 available because the inventory that was previously available for Monday and Tuesday has now been sold (on Wednesday).

    Attachment 468188
    If you use my formulas, or those proposed by the others below mine, in C6 you will have 100 (100 production less 0 orders). In D6 you will have 200 (100 from C6 plus 100 production less 0 orders). In E6 you will have 0 (200 from D6 plus 100 production less 300 orders). There is no need for any if statements.

  7. #7
    Registered User
    Join Date
    06-28-2016
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Create daily running total that subtracts from previous days when necessary

    Quote Originally Posted by gak67 View Post
    If you use my formulas, or those proposed by the others below mine, in C6 you will have 100 (100 production less 0 orders). In D6 you will have 200 (100 from C6 plus 100 production less 0 orders). In E6 you will have 0 (200 from D6 plus 100 production less 300 orders). There is no need for any if statements.
    Yes, I understand the formulas proposed and how they work, but that is where I'm running in to a problem. Those formulas don't adjust the Monday and Tuesday totals to reflect that there is no longer availability for those days because of the large order placed on Wednesday.

    As soon as the orders on Wednesday are updated to a value of 300, there will no longer be 100 available on Monday or 200 available on Tuesday. There will be 0 available for Monday, 0 available for Tuesday, and 0 available for Wednesday because the order for 300 pieces wiped out all of the previously available inventory.
    I would like the total in C6, D6, and E6 to reflect that zero value. I need a running total that adjusts not only forward, but backward as well as the orders come in... Hopefully this makes sense.

    I am looking for a formula that gives the following result in row 6:
    Capture.JPG
    Last edited by alijo; 06-28-2016 at 10:02 PM. Reason: added image

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Create daily running total that subtracts from previous days when necessary

    Add IF function ...

    =IF(SUM($C$5:C5),SUM($C$4:C4)-SUM($C$5:C5),0)

  9. #9
    Registered User
    Join Date
    06-28-2016
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Create daily running total that subtracts from previous days when necessary

    Quote Originally Posted by Phuocam View Post
    Add IF function ...

    =IF(SUM($C$5:C5),SUM($C$4:C4)-SUM($C$5:C5),0)

    Now is there a way to alter that formula to still give daily totals if all of that day's inventory has not been used up? And maybe keep the daily totals within their own columns instead of making a running total each day?

    For example:
    Capture.JPG
    Last edited by alijo; 06-29-2016 at 01:32 PM.

  10. #10
    Registered User
    Join Date
    06-28-2016
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Create daily running total that subtracts from previous days when necessary

    Quote Originally Posted by Phuocam View Post
    Add IF function ...

    =IF(SUM($C$5:C5),SUM($C$4:C4)-SUM($C$5:C5),0)
    The problem with that one is if all of my orders are 0, then my availability is also showing 0 instead of the actual values...

    Capture.JPG
    Last edited by alijo; 06-29-2016 at 11:28 AM.

  11. #11
    Registered User
    Join Date
    06-28-2016
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Create daily running total that subtracts from previous days when necessary

    Any other suggestions?

+ 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. Creating a Daily Running Total Query
    By theseekeroftru7h in forum Access Tables & Databases
    Replies: 0
    Last Post: 08-12-2009, 07:56 AM
  2. [SOLVED] Running Total from previous page
    By Vanna in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-05-2006, 04:35 AM
  3. [SOLVED] updated running total from previous pages
    By Steve in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  4. updated running total from previous pages
    By Steve in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. [SOLVED] updated running total from previous pages
    By Steve in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 AM
  6. updated running total from previous pages
    By Steve in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  7. updated running total from previous pages
    By Steve in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  8. [SOLVED] updated running total from previous pages
    By Steve in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 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