+ Reply to Thread
Results 1 to 12 of 12

auto weight calculating

  1. #1
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    auto weight calculating

    hi, i have some weights(kg) in cell A2. so i have two type of packages to fill that weights.one package is 1.5kg & other one is 1 kg. i want use that two package to fill that A2 cell weights with less different. always first priority need to give to 1.5 kg, but there are two conditions.

    01. always 0.5 kg need to add to A2 cell weights.
    02. for weight adjusting u can use only maximum 2 of 1 kg packages.

    so as a example to fill 13.8 kg result should like bellow..

    =13.8+0.5 = 14.3

    so i have to use 9 ,1.5 pks & 1, 1 kg pks. result will be - 14.5 ( that mean only different 0.2kg with actual requirement) if i use 10 of 1.5 kg, then result is =15 ,that mean i have used more than 0.7 kg. best option is first one.

    13.8
    1.5 kg -9
    1 kg -1
    pls check the sample sheet..
    so i don't no this is can manage with excel formula or not. so pls help me. thanks a lot...
    Attached Files Attached Files
    Last edited by johncena; 12-12-2013 at 01:28 AM.

  2. #2
    Registered User
    Join Date
    11-26-2013
    Location
    Norway
    MS-Off Ver
    Excel 2013
    Posts
    67

    Re: auto weight calculating

    Hi

    First I would change B1 and C1 to contain actual numbers instead of text, if you want to show the text "kg" it can be done with a custom number format.
    Then use this formula in b2:
    ROUNDDOWN((A2+0,5)/B$1,0)

    And use this in c2:
    ROUNDUP((A2+0,5)-(B$1*B2),0)
    Best regards

    Per Erik Midtr?d

  3. #3
    Registered User
    Join Date
    11-26-2013
    Location
    Norway
    MS-Off Ver
    Excel 2013
    Posts
    67

    Re: auto weight calculating

    Hi, please disregard my answer. I realized it doesn't work very good for packages less than 1 kg.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: auto weight calculating

    Hi,

    And does the combined weight need to be greater than the figure in column A+0.5kg? Or can it be less than also?

    For example, using your example above of 14.3kg, if I could achieve a combined weight of 14.2kg (which is closer to 14.3kg than your 14.5kg), would that be acceptable? Or is it not valid as it is less than the required amount?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: auto weight calculating

    If I understand the problem, it is similar to this one: http://www.excelforum.com/excel-form...ml#post2957674

    As in the previous case, I prefer to solve a problem like this so that I understand the math/algebra, then figure out how to program that solution into Excel.

    If I've understood, it looks like we want to solve the equation B*1.5+C*1>=A+0.5 Rearranged B*1.5+C*1-A-0.5>=0 and a minimum.

    As in the previous case, Solver might be a good way to solve a problem like this. Set up the spreadsheet to calculate the total weight at some assumed values for B and C, then call Solver and tell it to minimize the difference by changing B and C subject to the appropriate constraints (b and C are integers >=0 and the difference >=0).

    If you don't want to use Solver, you will probably have to program in your own trial and error algorithm.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: auto weight calculating

    Quote Originally Posted by XOR LX View Post
    Hi,

    And does the combined weight need to be greater than the figure in column A+0.5kg? Or can it be less than also?

    For example, using your example above of 14.3kg, if I could achieve a combined weight of 14.2kg (which is closer to 14.3kg than your 14.5kg), would that be acceptable? Or is it not valid as it is less than the required amount?

    Regards
    thanks for the reply. weight always greater than req. weight.

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: auto weight calculating

    I think that this works. I amended B1 and C1 so that they are numbers that could be used in calculations.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  8. #8
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: auto weight calculating

    Quote Originally Posted by newdoverman View Post
    I think that this works. I amended B1 and C1 so that they are numbers that could be used in calculations.
    thanks a lot fro your formulas. if weight is 14.1 then new calculation weights should be +14.1+.5=14.6, so your formula make answer 1.5kg=9 & 1kg=1, so total weight is =1.5*9+1*1=14.5, that mean it's 0.1kg less than new calculated weight. so pls help me to do this. thanks..

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: auto weight calculating

    I will take a look at this and see what I can do. I know upon seeing what I gave you that something is missing but right now I can't see what it is.

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: auto weight calculating

    After trying many different scenarios, I created a helper column (which is hidden) just to keep the formula as simple as possible. I got "stalled" on the possibilities of where having 2 1Kg weights is necessary as opposed to having 1 1.5 Kg and 1 1 Kg. The only situation where 2 1 Kg packages makes sense is where the total weight is up to 2 Kg.
    Attached Files Attached Files
    Last edited by newdoverman; 12-11-2013 at 08:25 PM.

  11. #11
    Forum Contributor
    Join Date
    02-14-2010
    Location
    oman
    MS-Off Ver
    Excel 2003
    Posts
    384

    Re: auto weight calculating

    Quote Originally Posted by newdoverman View Post
    After trying many different scenarios, I created a helper column (which is hidden) just to keep the formula as simple as possible. I got "stalled" on the possibilities of where having 2 1Kg weights is necessary as opposed to having 1 1.5 Kg and 1 1 Kg. The only situation where 2 1 Kg packages makes sense is where the total weight is up to 2 Kg.
    thanks a million sir. u gone a great job. thanks again..

  12. #12
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: auto weight calculating

    You're welcome and thank you for the feedback.

+ 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. Auto Calculate Shipping Weight/Cartons and Package Weight.
    By suhailsiddiqui09 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-27-2013, 06:48 AM
  2. Calculating weight
    By br0die in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-21-2012, 12:17 AM
  3. [SOLVED] calculating postage costs based on weight but only if postage is required.
    By waitey1234 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-02-2012, 03:28 PM
  4. Calculating Average Weight Gain Per Week
    By erin1684 in forum Excel General
    Replies: 4
    Last Post: 07-13-2010, 01:23 PM
  5. Weight loss line chart to monitor weight loss progress
    By S Fox in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 11-08-2005, 01:15 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