+ Reply to Thread
Results 1 to 10 of 10

Error of calculations - Don't know where is the problem

Hybrid View

glpx Error of calculations - Don't... 07-02-2014, 05:15 AM
nathansav Re: Error of calculations -... 07-02-2014, 05:23 AM
glpx Re: Error of calculations -... 07-02-2014, 06:09 AM
nathansav Re: Error of calculations -... 07-02-2014, 06:15 AM
glpx Re: Error of calculations -... 07-02-2014, 06:21 AM
nathansav Re: Error of calculations -... 07-02-2014, 06:30 AM
glpx Re: Error of calculations -... 07-02-2014, 08:23 AM
nathansav Re: Error of calculations -... 07-02-2014, 09:48 AM
glpx Re: Error of calculations -... 07-02-2014, 11:00 AM
glpx Re: Error of calculations -... 07-04-2014, 05:50 AM
  1. #1
    Registered User
    Join Date
    07-01-2014
    Location
    Toulouse
    MS-Off Ver
    Office 2007
    Posts
    9

    Unhappy Error of calculations - Don't know where is the problem

    Hello everybody,

    I've worked on a file who permits to exploit a database. This database includes many informations about the sizing and the weight of packagings. This informations used to calculate the palettization.

    The calculations give the following results :

    - Number of box / coat
    - Number of coat on the pallet
    - Number of box / pallet
    - Height of pallet
    - Weight pallet

    The problem is in the pallet's weight. To calcul this, the formula is :

    Weight = Nb box * weight gross (of 1 box) + 20 (Kg, Weight pallet)

    When I simulate a calcul with any box, I don't have the good result, always less than the real result. But the formula is writting good.

    Sans titre.png
    Normally, we have to find 168 kg and not 140...
    Calcul = 40 * 3.7 + 20 = 168 kg

    Someone can find the error in the writting vbe ? Thanks
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Error of calculations - Don't know where is the problem

    Your decimal separtor is a comma, could that be it.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    07-01-2014
    Location
    Toulouse
    MS-Off Ver
    Office 2007
    Posts
    9

    Re: Error of calculations - Don't know where is the problem

    Thanks @Nathansav but this is just the explanation.

    The formula in vba is : HauteurPalette = NbCouches * Hext + (Sheets("Palettisation").Range("C2").Value * 1000)
    It's the same and correctly written... This is my problem. I don't where is the fault.

    The writting is located on the code of user form.

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Error of calculations - Don't know where is the problem

    Can you send me the data for these values, not the sheet, just some of the examples so that i can see.

    have you tried changing the values from the sheet to double?

  5. #5
    Registered User
    Join Date
    07-01-2014
    Location
    Toulouse
    MS-Off Ver
    Office 2007
    Posts
    9

    Re: Error of calculations - Don't know where is the problem

    No i didn't try because i'm not an expert...

    If Hext = "" Or Hext = 0 Then
    MsgBox ("Hauteur ext non renseignée")
    Else
    NbCouches = Int((comboNonGerbable.Value - Sheets("Palettisation").Range("C2")) * 1000 / Hext)
    NbCartonsPalette = NbCouches * NbCartonsCouches
    HauteurPalette = NbCouches * Hext + (Sheets("Palettisation").Range("C2").Value * 1000)
    PoidsPaletteBrut = PdsBrut * NbCartonsPalette + 20
    Label18.Caption = NbCartonsCouches
    Label20.Caption = NbCouches
    Label22.Caption = NbCartonsPalette
    Label24.Caption = HauteurPalette
    Label26.Caption = PoidsPaletteBrut
    End If

    ______________________________________________________________________________

  6. #6
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Error of calculations - Don't know where is the problem

    can you send me the data also, so i can redo the calculations. One thing to look at, is a thing called BODMAS, brackets of division multiplication and subtraction, it may be something wiht your braketing in

    Int((comboNonGerbable.Value - Sheets("Palettisation").Range("C2")) * 1000 / Hext)

  7. #7
    Registered User
    Join Date
    07-01-2014
    Location
    Toulouse
    MS-Off Ver
    Office 2007
    Posts
    9

    Re: Error of calculations - Don't know where is the problem

    Thank you so much for your help !!
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Error of calculations - Don't know where is the problem

    No problems, can you just send me the values yuo were using for these variables

    NbCouches = Int((comboNonGerbable.Value - Sheets("Palettisation").Range("C2")) * 1000 / Hext)
    NbCartonsPalette = NbCouches * NbCartonsCouches
    HauteurPalette = NbCouches * Hext + (Sheets("Palettisation").Range("C2").Value * 1000)
    PoidsPaletteBrut = PdsBrut * NbCartonsPalette + 20

    What you expect to get and what you did. I will check out your calc then. I am 99% its a bracket in the wrong place

  9. #9
    Registered User
    Join Date
    07-01-2014
    Location
    Toulouse
    MS-Off Ver
    Office 2007
    Posts
    9

    Re: Error of calculations - Don't know where is the problem

    For this variable, it's your choice on the macro, you can use any box present in the list.

    Example :

    Name : Barquettes
    Dim exterior box : 356 - 239 - 248 mm
    Weight : 3,7 kg x (nb box / pallet = 40 )

    For comboNonGerbable there is a panel of value = 1,60 - 1,65 - 1,70 - 1,75 - 1,80 - 1,85
    Sheets("Palettisation").Range("C2") is the height of the pallet = 0,15

  10. #10
    Registered User
    Join Date
    07-01-2014
    Location
    Toulouse
    MS-Off Ver
    Office 2007
    Posts
    9

    Re: Error of calculations - Don't know where is the problem

    Hello Nathansav ! Have you seen any things wrong on the file ?

+ 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. [SOLVED] Problem with calculations.
    By tearfulkarma in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-31-2013, 09:51 AM
  2. Error in calculations using percentages
    By Gomeztsi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-20-2012, 12:15 PM
  3. Excel 2007 : Rounding Error in Excel calculations
    By coveredup in forum Excel General
    Replies: 1
    Last Post: 01-31-2012, 01:33 PM
  4. Calculations in Time Problem
    By scottymelloty in forum Excel General
    Replies: 6
    Last Post: 11-29-2005, 12:10 PM
  5. Calculations Error.
    By bchowdhury in forum Excel General
    Replies: 3
    Last Post: 05-05-2005, 10:38 AM

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