+ Reply to Thread
Results 1 to 6 of 6

Help combining formulas or suggest a better way?

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

    Help combining formulas or suggest a better way?

    Dear Forum,

    I was wondering if someone could help me combine formulas that I currently have in the attached worksheet or maybe suggest a better formula. In the sample attached I am trying to find the cheapest way to order paint. There is slight decrease in cost per litre as you order in bulk.
    Currently I have a very akward way of getting there (and it hurt just coming up with it).

    The intent is for the user to enter the required #of litres in cell A1 and for the least expensive option be returned in F15 with the breakdown of varies container size quantities in cells E12:F14

    I have used fill colors to help see where the 'relevent' results are currently linked. Idealy I could simplify the process by having a formula in E12:E14 that would have the same result.

    I think it wil make sense what I'm saying when you see the worksheet.

    Thank you for any suggestion you can offer.
    Attached Files Attached Files
    Last edited by Cidona; 01-08-2012 at 03:21 AM. Reason: Had forgotten to mention where the user input begins (A1). Edit #2. 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
    48,189

    Re: Help combining formulas or suggest a better way?

    I think this does it:

    =($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


    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 Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Help combining formulas or suggest a better way?

    Perhaps this approach can be used:

    Please Login or Register  to view this content.
    Now the extended total is this:
    Please Login or Register  to view this content.
    Or...if you want one formula that calculates all quantities of all sizes and the final price:
    Please Login or Register  to view this content.

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

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

    Re: Help combining formulas or suggest a better way?

    TMShucks and Ron, Thank you both very much for your solutions. Both work and have helped me gain knowledge on some very useful functions I previously did not know were there, never mind know how to use (namely MOD, INT, CEILING (and now could use FLOOR in the future also).

    Funny how you guys can just string these formulas together, I get dizzy.

    TM, I had to break your one down (into cells E12:E14), and use the evaluation formula tool to understand yours properly, but see what your doing now.

    Ron, that's a really nice clean way of getting there. I am looking for the break down of containers so was looking for the solution provided in your first 'Code box'.

    Thank you both again for your help and hope you have a great 'weekend'

  5. #5
    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
    48,189

    Re: Help combining formulas or suggest a better way?

    You're welcome. Thanks for the rep.

    Sorry if it was confusing; I thought you wanted one formula?



    Regards, TMS

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

    Re: Help combining formulas or suggest a better way?

    Not at all TM. There was good learning in the breaking down for me anyway. Sorry for the confusion.

    I'm afriad I had a couple of issues with the solution and as I have marked this thread as solved and as I think the situation will require other than the combination of formulas I had provided, I have started a new thread titled 'Find best combination of containers to determine least expensive paint order' which can be found here
    http://www.excelforum.com/excel-new-...int-order.html

    The problems are outlined in the new post so I won't double up here. If anyone can provide further assistance on the new thread, I would be very grateful.

+ 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