+ Reply to Thread
Results 1 to 4 of 4

calculation .goes worng

  1. #1
    Forum Contributor
    Join Date
    10-02-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2016
    Posts
    140

    calculation .goes worng

    Hi...

    I need help

    I have program in excel where after i run this program the calculation which calculate is wrong

    example

    In sheet data in column H..there is field name Quantity..

    if the the Quantity is 40 * 30 = 1200
    but what i get is = 1727481


    I have attached the program..



    Thanks
    Mraj
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: calculation .goes worng

    Your post does not comply with Rule 1 ** our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    10-02-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2016
    Posts
    140

    Calculation for calculate quantity

    Hi..



    I have source code but this code is not working as i want

    Dim x, i As Long, P As Long, k As Long, n As Long
    With Sheets("Data").Range("a1").CurrentRegion
    x = .Value
    End With
    With CreateObject("Scripting.Dictionary")
    .CompareMode = 1
    For i = 2 To UBound(x)
    If Not .exists(x(i, 1)) Then
    n = n + 1
    .Item(x(i, 1)) = n
    For k = 1 To UBound(x, 2) - 2
    x(n, k) = x(i, k)
    Next k
    x(n, k + 1) = "calculation is (total Quantity * 30)= Overall Total"
    Else
    x(.Item(x(i, 1)), 8) = x(.Item(x(i, 1)), 8) + x(i, 8)
    x(.Item(x(i, 1)), 9) = x(.Item(x(i, 1)), 8) * 30
    End If
    Next i

    End With
    With Sheets("OutPut")
    .UsedRange.Offset(1).ClearContents
    .Range("A2").Resize(n, UBound(x, 2)).Value = x
    .Columns.AutoFit
    .Activate
    End With


    example

    In sheet data in column H..there is field name Quantity..

    if the the Quantity is 40 * 30 = 1200
    but what i get is = 1727481


    I have attached the program..


    Thanks
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    10-02-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2016
    Posts
    140

    Re: calculation .goes worng

    Ok..

    I'm sorry for this..


    Thanks

+ 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. Replies: 1
    Last Post: 09-24-2013, 03:03 AM
  2. Replies: 1
    Last Post: 09-24-2013, 02:06 AM
  3. Replies: 1
    Last Post: 01-15-2013, 08:51 AM
  4. [SOLVED] Conditional statement calculation based on result of previous calculation.(Need some help)
    By takeprofit in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-01-2012, 01:45 AM
  5. Add an amount from a calculation to a cell with a calculation (Sample attached)
    By aiwnjoo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2010, 10:41 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