+ Reply to Thread
Results 1 to 16 of 16

Sumproduct calculation

  1. #1
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Sumproduct calculation

    Hi I have a spreadsheet that incorporates a sumproduct formula (i have attached a scaled down version of the sheet for reference)

    I need to the sheet to be able to take an amount off the stock of a certain type and when that stock is exhausted start taking it off another section.

    Any queries please post.

    Thanks in advance.
    Last edited by john dalton; 07-29-2011 at 08:56 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Problem with sumproduct calculation

    I am not sure I understand fully.

    Can you fill in some numbers and expected results.. and describe how achieved.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Problem with sumproduct calculation

    here is an updated sheet with descriptions

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Problem with sumproduct calculation

    Forgive me, still confused a bit..

    You want formulas in J5 and O5 or in B5:B7?

    Which are manual inputs?

  5. #5
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Problem with sumproduct calculation

    calculations required in J5 and O5 - the manual inputs are in columns A, C and D as stock comes in and goes out

    Cheers JD

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Problem with sumproduct calculation

    So would it be?

    =SUMPRODUCT(--($C$5:$C$7=$G5),($B$5:$B$7))-O5

  7. #7
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Sumproduct calculation

    Brilliant!

    I also need it to display maximum opex stock out once the correct stock has been exhausted at present if you take 10 items out of capex and then 60 out of opex it displays -10 in the opex running stock column - is there any way to max out the level at 0 once the stock has been fully used?

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sumproduct calculation

    Try:

    =MAX(0,SUMPRODUCT(--($C$5:$C$7=$G5),($B$5:$B$7))-O5)

  9. #9
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Sumproduct calculation

    Still goes over the maximum allowable amount and puts -10 in K5

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sumproduct calculation

    Sorry, I thought you were referring to the J5 cell...

    Try in K5:

    =MAX(0,SUM(H5+I5)-J5)

  11. #11
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Sumproduct calculation

    Thanks works a treat

  12. #12
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Sumproduct calculation

    Updated please see below
    Last edited by john dalton; 07-18-2011 at 10:12 AM.

  13. #13
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Sumproduct calculation

    Hi the calculation works a treat however there is a side-effect that I cant seem to rectify -

    The problem I have is that when you then put stock into the capex stock in column it then changes the opex stock out and adjusts it to whatever you have entered in the stock in cloumn.

    Example - if you have 10 of 001 out of the capex stock to reduce it to zero and the next stock out is 50 to reduce the opex stock level also to zero the next time you enter new stock into capex as incoming stock it automatically alters the opex stock out cloumn (K5) and adjusts it to whatever you have enetered.

    I need both coloumns to work independantly of each other once the initial process is done.

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sumproduct calculation

    Without a sample file with the entries you are suggesting to make, I do not follow. Please post another sample workbook with the formulas in place and the entries you suggest in place and then tell us what the problem is.

    Note that you cannot "freeze" values that are gotten from formulas... Formulas are active all the time and will change the results if dependent cells values are changed.

  15. #15
    Forum Contributor
    Join Date
    04-02-2010
    Location
    penrith
    MS-Off Ver
    Excel 2007
    Posts
    522

    Re: Sumproduct calculation

    I think thats what im trying to achieve - because as soon as I enter some more capex stock into the stock holding it changes the figures in the opex stock. Please see attached sheet for details.

  16. #16
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sumproduct calculation

    Your formula in K5 subtracts the amount that is in P5 and P5 depends on the formula that is in O5, which in turn depends on F5:F7, so K5 will always be affected.

    Perhaps you need to rethink the logic a bit.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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