+ Reply to Thread
Results 1 to 20 of 20

Find best combination of containers to determine least expensive paint order

  1. #1
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Find best combination of containers to determine least expensive paint order

    Dear Forum.

    I would like to mention in advance of the problem, that this is closely related to my previous post titled 'Help combining formulas or suggest a better way?'.

    I have started this as a separate post as (a) I had marked the previous thread as solved and (b) this is proably going to require a different solution and the description of combining formulas is not accurate in that respect. If I have misinterpreted the Forum Rules in this respect, please forgive me and indicate how best I should proceed.

    Here is the link to that previous thread http://www.excelforum.com/excel-new-...etter-way.html

    I will provide a link on the previous thread to this one so that future users will be able to follow through also.

    I would not usually be looking for help in such a short period and considered waiting for a period prior to posting (as I'm lost as to how to proceed), but figured it would be better to repost while the workbook was still fresh and familar to those who had previously responded (namely Ron Coderre and TMShucks - thank you both again), in case they are in a position to provide further guidance.

    I have attached a workboook with the solution kindly provided by Ron Coderre. TMShucks method in the previous thread also works in the same manner when broken down into cells E12:E14 just using slightly different fomula.

    At this point I must apologize to both Ron and TM as I fear I lead you down the wrong path with the formulas I provided to be combined.

    While the workbook seemed to be working great and I was able to see signifigant savings in cell F15 over the options in cells F7:F9 (e.g. 2100 litres), there are a couple of situations where it does not provide the correct result.
    (a) When I enter 950 (Litres) in cell A1 the result is not truely the least expensive way of ordering. The cheapest way of ordering would be a single 1,000 Litre container at 8,500 euro. However the formula is set up such that if there is less than a single 1,000 Litre conatainer required, it rounds off to 0 and continues to configure the order with the other sizes.
    (b) Another problem with the way I had started trying to determine the least expensive way to order is that is based on the assumption that the larger containers will always be cheaper per litre. There could be situation where a supplier has the 208.1 Litre containers on special (for example), where starting with the largest container might not be the most cost effective means.

    Any idea how to overcome these issues? Thank you for any help you can provide.
    Attached Files Attached Files
    Last edited by Cidona; 01-09-2012 at 04:48 PM. Reason: Marked as Solved

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Find best combination of containers to determine least expensive paint order

    Based on my original formula, maybe:

    =MIN(($A1-MOD($A1,$A$9))/$A$9*$B$9+(MOD($A1,$A$9)-MOD(MOD($A1,$A$9),$A$8))/$A$8*$B$8+ROUNDUP(($A1-((A1-MOD($A1,$A$9))+(MOD($A1,$A$9)-MOD(MOD($A1,$A$9),$A$8))))/$A$7,0)*$B$7,ROUNDUP($A1/$A$9,0)*$B$9)

    You could also extend this to calculate the cost based only on the middle price ...

    =MIN(($A1-MOD($A1,$A$9))/$A$9*$B$9+(MOD($A1,$A$9)-MOD(MOD($A1,$A$9),$A$8))/$A$8*$B$8+ROUNDUP(($A1-((A1-MOD($A1,$A$9))+(MOD($A1,$A$9)-MOD(MOD($A1,$A$9),$A$8))))/$A$7,0)*$B$7,ROUNDUP($A1/$A$9,0)*$B$9,ROUNDUP($A1/$A$8,0)*$B$8)


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Find best combination of containers to determine least expensive paint order

    Thank you for the reply TM!
    Afriad though while your formula does take care of issue (a), issue (b) is still at hand.

    As an example, (working with a 950 litre required paint) if the supplier was to have a blow out sale on the 19 litre containers, selling them off at 19 euro a piece (so the difference can be easily seen), then the cheapest option would be to buy all the paint in the 19 litre containers which would be 50 of the 19 litre containers for a total of 950 euro. With your formula the result is 7,533 euro.

    Any ideas on how to rectify. This solution will work for the most part as it would be unusal for such a discount, however it would be nice to have a 'fool proof' method.

    Thank you again for your consideration.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Find best combination of containers to determine least expensive paint order

    Just add a further element to the minimum calculation ...

    ROUNDUP($A1/$A$7,0)*$B$7


    =MIN(($A1-MOD($A1,$A$9))/$A$9*$B$9+(MOD($A1,$A$9)-MOD(MOD($A1,$A$9),$A$8))/$A$8*$B$8+ROUNDUP(($A1-((A1-MOD($A1,$A$9))+(MOD($A1,$A$9)-MOD(MOD($A1,$A$9),$A$8))))/$A$7,0)*$B$7,ROUNDUP($A1/$A$9,0)*$B$9,ROUNDUP($A1/$A$8,0)*$B$8,ROUNDUP($A1/$A$7,0)*$B$7)



    Regards, TMS

  5. #5
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Find best combination of containers to determine least expensive paint order

    Hi TM.

    Thank you again for your help!!

    Your formula does indeed now provide the least expensive, however I'm having problems being able to break down the container quantities.

    Please find attached revised worksheet. This has your new formula in F18.

    Please see where I had previously broken out your formula (without multiplying by the prices), (the one you provided in my previous thread), in cells E12:E14. I have these without the "=" sign in cells H12:H14 for viewing. This (cells E12:E14), was telling me how many of each container type I should have. I was just multiplying this quantity by the container price as provided in cells B7:B9.

    How can I populate cells E12:E14 with the preferred number of containers with the new additional parameters?

    Thank you for your patience.
    Attached Files Attached Files
    Last edited by Cidona; 01-08-2012 at 05:33 PM. Reason: Forgot to attach file

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find best combination of containers to determine least expensive paint order

    You could do this using Solver:

    Please Login or Register  to view this content.
    Set B4 to Min by changing C7:C9 subject to the constraints

    A4 >= 0
    C7:C9 = integer
    C7:C9 >= 0
    Last edited by shg; 01-08-2012 at 06:16 PM.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Find best combination of containers to determine least expensive paint order

    See the attached amended example ... unless you want to go with shg's solution.

    Regards, TMS

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find best combination of containers to determine least expensive paint order

    My solution wasn't working so hot, and I haven't had time to play with it.

  9. #9
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Find best combination of containers to determine least expensive paint order

    Thank you very much for the suggestion shg. I have incorporated a manual selection into my worksheet (slightly different configuration but same concept, i.e. multiplying price by user quanty input). I was thinking it would be good to have this for situations where it is not practical to bring a 1,000 litre container into a given project (in the phyical world). However I am trying to make it to prevent users making the wrong selection. There are several other aspects that I have configured for use with this portion of the 'tool', where the user enter's various inputs to dertermine the correct ammount of paint to input in this section. Therefore this is one aspect that if posible I would like to automate/fool proof.

    I have attached the updated workbook. This has the user input option incorporated. However in cells B10:B12 the formula is my broken down version of TM's original. If posible I would like to have this populate with the correct optimum numbers for the various ammounts. My only thought on how to approach would be posibily with nested ifs into TM's section of formula for each of those cells (B10:B12), but it seems almost like infinite IFs and I'm not great at stringing together.

    Please note the workbook configuration has changed, due to the user input section and a general cleanup. If anyone is able to respond and it is easier to reference the previous workbook please let me know which one you are referencing. I have named the new workbook as 'FindCheapestPaintAdjTMShucks2' rather than .....1.

    Any ideas on what to input in B10:B12 to get the automated quantities?
    Thank you for your imput.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Find best combination of containers to determine least expensive paint order

    Had posted inbetween reading shg's 1st response and your last one TM. So hadn't read your response when I posted. I'll will review your solution. Thank you again for your assistance.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Find best combination of containers to determine least expensive paint order

    I have revisited the example to "tidy up" some of the formulae and provide alternative versions.

    Also added Conditional Formatting to highlight the minimum value.


    Regards, TMS

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Find best combination of containers to determine least expensive paint order

    Probably getting silly now, but this version contains some custom formatting so that you can change the container sizes and the descriptions will match the changes.

    Regards, TMS

  13. #13
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Find best combination of containers to determine least expensive paint order

    Hi TM.
    Thank you for very much for your reply.

    Let me first say that I didn't mean to be bringing you on such a trip here. When I posted I didn't know if maybe Excel had some built in function for performing such an evaluation or how involved it would be. Alot of what you experts can do with this program seems straight up like magic to me. It seems that there is not such a pre-packaged solution to this and to have the program do such requires some very careful creative math.

    I am mentioning this therefore not in expecting a solution (though it you can that would be great), but rather to inform you/others in cases you/other are wishing to utilize this method in a similar situation....In certain circumstances it is still not finding the true cheapest method of ordering (sorry). (Unless I'm missing something).

    Your formula are a bit too involved for me to troubleshoot and I'm not sure with what parameters it gets caught off guard. However if you see the attahed worksheet (which has your latest workbook incorportated, the formula is determining the for 2800 litres the least expensive method would be €24,540.00. However by using the 'User Selection' where the quanities are manually input, it would seem the least expensive way of ordering would arrive at €24,400.00 (€140.00 saving).

    In the attached workbook I have inserted your 'tool' into rows 1-9, utilzing the lower sections for anaylsis and the user input. The intent would be to hide rows 1-9.

    Again I am mentioning this for your information rather than expecting a solution as I see it got quiet involved so far. As your sign off says 'Behind everything simple is a huge tail of complicated'.

    BTW, in cells E2:E4, how are you getting the text in there with the number (as it is referencing cells with just numbers)??? Hadn't come accross that before.

    Thank you again for your time in this matter.
    Attached Files Attached Files

  14. #14
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Find best combination of containers to determine least expensive paint order

    The easy answer first: you get the "descriptive text" added to the number by using a Custome Format:

    "# of " #,##0.00 " Litre Containers"


    As for the calculation, the only way that I can see of doing this is to "step through" the various combinations of container size:

    1. Majority 19.00 plus remainder at 208.10
    2. Majority 19.00 plus remainder at 1000.00
    3. Majority 208.10 plus remainder at 1000.00
    4. Majority 208.10 plus remainder at 19.00
    5. Majority 1000.00 plus remainder at 19.00
    6. Majority 1000.00 plus remainder at 208.10
    7. All at 19.00
    8. All at 208.10
    9. All at 1000.00
    10. Mix: calculating down from 1000

    Then take the minimum cost from the above 10 calculations ... I've done 4 of them so far.

    I suspect there could still be some variants that this won't cater for. It could, however, be wasteful. I'm sure there could be some number, say a little over a 1000, where 2000 litres would be most cost effective. Assuming the customer opened the second container and could not, therefore, return it, they would be left wit nearly a 1000 litres of paint to use or dispose of.

    Let me know if you need the other calculations doing ... they shouldn't be that difficult ... but it might be worth your while trying them for yourself.


    Regards, TMS

  15. #15
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Find best combination of containers to determine least expensive paint order

    TM, Thank you so much for your patience over the weekend.

    Home free now. The INDEX structure allows me to enter the formulas several ways now (using my newly aquired INT, CEILING, ROUNDUP, ROUNDDOWN and MOD function

    Thanks also for the Custom Format tip, I had previously only formatted cells for number/date reasons.

    I'm a little surprised that excel doesn't have a function built in to do this type of 'function'. Would seem to be a worthwhile facility for many people/companies. Would seem to really twist the melon if you were dealing with say 10 different container sizes, entering 'custom catch all' formulas for the range in posibilities that could exist with larger number of containers.

    I mostly only get to do this excel learning in spare time; until a few years ago I thought excel was just for aligning things in straight columns. Wish someone had opened my eyes way back.

    While it can be frustrating trying to get the hang of it, thanks to you and the other generous contributors on this forum the likes of myself can still have fun learning it and can come away with useful worksheet and a bag of tricks for the next one.

    Thank you so much!

  16. #16
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,428

    Re: Find best combination of containers to determine least expensive paint order

    You're very welcome. Thanks for the rep.

    I'm a little surprised that excel doesn't have a function built in to do this type of 'function'.

    I think that's what Solver is supposed to do but I've never used it in anger and it seems a bit like hard work. I'm sure, if I spent some time on it, it would be useful. Ho hum.

    Regards, TMS

  17. #17
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Find best combination of containers to determine least expensive paint order

    Hum, I guess I completely missed shg's proposal. I was thinking the intent was for the user to input (manually)in cells C7:C9 with the constraints he mentioned at the end. Upon further investagation, there seems to be more to it. However the Solver add on doesn't let me input shg's 2nd constraint 'C7:C9 = integer'. I get the message 'Constraint must be a number, simple reference, or formula with a numeric value.

    Further investagation needed.

    Thanks again.

  18. #18
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Find best combination of containers to determine least expensive paint order

    When you click on the comparison operator box, one of the choices is "int." Another is "bin" (binary").

  19. #19
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Find best combination of containers to determine least expensive paint order

    Thanks for the response shg.

    However in my attept this doesn't find the least expensive option.

    I'll start a new thread and provide a link to this as I have already marked this thread as solved.

    Hope you can respond to the new one.

    Thanks again!

  20. #20
    Forum Contributor
    Join Date
    04-27-2010
    Location
    Kinsale, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Find best combination of containers to determine least expensive paint order

    Thank you very much for your reply shg.

    As I had previously marked this thread as solved and since it may be useful for others to search with 'Solver' criteria, I have started a new thread named 'Find cheapest paint with solver'. The link for said new thread is provided below.

    It would be great if you can provide further guidance on the new thread as it seems that this could be a powerful tool for dealing with multiple sizes of containers...

    Thank you for your previous input and any further direction you can provide.

    http://www.excelforum.com/excel-new-...html?p=2680219

+ 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