+ Reply to Thread
Results 1 to 13 of 13

Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

  1. #1
    Registered User
    Join Date
    03-08-2018
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    13

    Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    Hi,

    I am having a lot of difficulty trying to come up with a formula for the following table that will look at the cumulative shortfall for prior months and if available add the shortfall to the Sales in the current month. For example, the cumulative shortfall in Aug is 41 ( 6 in May, 17 in June & 18 in July) and there is 11 extra units that can be sold (August amount in Stock-Sales column). I would like the formula to add the 11 units to sales in August to arrive at 20 units (currently at 9). Next month, there should only be 30 units available in the shortfall as 11 were used in August. In September, the formula needs to know that there are only 30 units of shortfall remaining this month (11 of the 41 were used in August) and as result only 30 can be added to the Expected Sales column in September even though there is stock of 36 in the Stock-Sales (Max)Column. Obviously, the remainder of the year has zero shortfall remaining so if the formula is correct the Expected Sales should stay the same as is for Oct-Dec.

    excel problem.JPG

    Thanks
    Last edited by altwood; 03-28-2021 at 12:56 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    You talk about "add to revenue", but there is nothing labelled revenue. What are your expected answers (calculated manually) & where do you expect to see them?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    03-08-2018
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    13

    Re: Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    Quote Originally Posted by Glenn Kennedy View Post
    You talk about "add to revenue", but there is nothing labelled revenue. What are your expected answers (calculated manually) & where do you expect to see them?
    Sorry, I should have clarified that I meant "Expected Sales". Revenue/Sales are interchangeable where I work which is why I overlooked that. I updated the wording in the original post.
    Last edited by altwood; 03-28-2021 at 12:21 PM.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    Hahahaha. And I'm an analytical chemist and such interchangeabilities are totally foreign to me....

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,099

    Re: Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    Did you add manually calculated expected results as requested?? Refer to the second sentence of Post 2.

  6. #6
    Registered User
    Join Date
    03-08-2018
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    13

    Re: Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    Quote Originally Posted by Glenn Kennedy View Post
    Did you add manually calculated expected results as requested?? Refer to the second sentence of Post 2.
    I just added a new file to the original post which shows the "correct" sales amounts that I would expect to see and the cumulative shortfall balance per month and amounts used each month. You can put them in new columns like I have. Hope this helps.
    Last edited by altwood; 03-28-2021 at 01:11 PM.

  7. #7
    Registered User
    Join Date
    03-08-2018
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    13

    Re: Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    Quote Originally Posted by Glenn Kennedy View Post
    Hahahaha. And I'm an analytical chemist and such interchangeabilities are totally foreign to me....
    Haha, Yeah that was my fault I should of made it consistent.

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,242

    Re: Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    Why is the calculation what not I consider to be the "norm":

    Opening Stock + Stock Received - Sales (actual)

    Why are you adding the 11 to "Expected Sales" ?

    or more ... curious !

  9. #9
    Registered User
    Join Date
    03-08-2018
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    13

    Re: Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    Quote Originally Posted by JohnTopley View Post
    Why is the calculation what not I consider to be the "norm":

    Opening Stock + Stock Received - Sales (actual)

    Why are you adding the 11 to "Expected Sales" ?

    or more ... curious !
    "Expected Sales" cannot exceed "Expected Stock" in the month. If the Forecast is higher than the Expected Sales (due to Expected sales being limited by lower "Expected Stock" than forecasted) then there is a shortfall in the forecast for that month (revenue did not meet forecast). Currently, Sales cannot exceed the forecast so they will max out at the Forecast amount in the month even if there is more stock available in the month than forecast. The idea of the formula I am looking for is to correct this and look at the available stock in the given month and the cumulative forecast shortfall for prior months and max out any cumulative forecast shortfall up to the available stock in the month or the cumulative shortfall which ever is less. For example, in a month if Forecast is 8, Sales are 8, Stock is 20 and Cumulative forecast shortfall for prior month is 7 then I would expect sales to be 15. The cumulative balance should reset to zero in the following month as the shortfall was used up unless of course there is new shortfall. I hope that makes sense.

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

    Re: Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    This proposal employs two helper columns which may be moved and/or hidden for aesthetic purposes.
    The first helper column (L) is populated using: =SUM(L1,-MIN(0,B2-C2))
    The second helper column (M) is populated using: =IF(L2=0,0,MIN(L1-M1,MAX(0,B2-C2)))
    The Expected Sales column is now populated using: =MIN(B2,SUM(C2,F1))
    The Forecast - Sales (Cumulative) column is now populated using: =MAX(0,L2-SUM(M$2:M2))
    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.

  11. #11
    Registered User
    Join Date
    03-08-2018
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    13

    Re: Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    Quote Originally Posted by JeteMc View Post
    This proposal employs two helper columns which may be moved and/or hidden for aesthetic purposes.
    The first helper column (L) is populated using: =SUM(L1,-MIN(0,B2-C2))
    The second helper column (M) is populated using: =IF(L2=0,0,MIN(L1-M1,MAX(0,B2-C2)))
    The Expected Sales column is now populated using: =MIN(B2,SUM(C2,F1))
    The Forecast - Sales (Cumulative) column is now populated using: =MAX(0,L2-SUM(M$2:M2))
    Let us know if you have any questions.
    Great job, this is exactly what I am looking for. I figured it would be something out of the box like this. I was trying to solve it with sum ifs, etc but it did not come across my mind to use max/min.

    Thank you very much.

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

    Re: Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

  13. #13
    Registered User
    Join Date
    03-08-2018
    Location
    Toronto
    MS-Off Ver
    2016
    Posts
    13

    Re: Formula which adjusts current cell to "catchup' for shortfall in rows/cells above.

    Done. Thanks and you too!

+ 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: 3
    Last Post: 07-01-2020, 10:15 AM
  2. Formula to SUM from the "Start" of the Header to cell above current
    By dluhut in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-04-2019, 02:16 PM
  3. [SOLVED] Find "Total Hours" by searching entire rows below selected cell vs. cells in a column
    By moosetales in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-20-2014, 12:30 PM
  4. [SOLVED] Formula Needed to fill multiple cells with "No" when the word "No" is entered into a cell
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-09-2013, 05:36 PM
  5. [SOLVED] Insert rows based on the current cell value and, then, copy some cells into the new rows
    By Excel-RZ in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-03-2013, 05:19 PM
  6. Replies: 0
    Last Post: 08-21-2011, 11:53 AM
  7. Reference to "current cell" in formula?
    By AndyF in forum Excel General
    Replies: 5
    Last Post: 07-20-2009, 12:46 PM

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