+ Reply to Thread
Results 1 to 2 of 2

can't get the right figure

Hybrid View

associates can't get the right figure 10-19-2006, 12:14 AM
Bryan Hessey Not quite suure what I am... 10-19-2006, 04:33 AM
  1. #1
    Forum Contributor
    Join Date
    06-04-2006
    Posts
    132

    can't get the right figure

    Hi,

    I was wondering if anyone might be able to help me here. this has been giving me grieve and frustration. I haven't been able to get the right result from this calculation below.

                            If gradeCalculate = False Then
                                myGrade = ((myH2 - myH1) / (myCH2 - myCH1)) * percentage
                                gradeCalculate = True
                            End If
                            
                                Worksheets("Result").Range(myGCell).Value = myGrade
                                myDist = CDbl(Worksheets("Controls").Range(myHCell))
                                mytemp = (myGrade * myDist) / percentage
    I have declared both myGrade, mytemp, and percentage as double. mytemp still gives me the wrong figure.

    I have checked it by going steps by steps thru the line of code. I got both myGrade and myDist showing the right figure. for example
    myGrade is 1.2 (from calculation)
    myDist is 108.5 (from calculation)
    percentage = 100 (user defined)... i have tried to define percentage to be 100.0 but it changes itself to 100#. (don't know why)
    and mytemp shows 85, instead of 84.90

    Is there a way of getting around this problem in excel? because the work i'm working on require very accurate figures.

    Thank you in advance

  2. #2
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by associates
    Hi,

    I was wondering if anyone might be able to help me here. this has been giving me grieve and frustration. I haven't been able to get the right result from this calculation below.

                            If gradeCalculate = False Then
                                myGrade = ((myH2 - myH1) / (myCH2 - myCH1)) * percentage
                                gradeCalculate = True
                            End If
                            
                                Worksheets("Result").Range(myGCell).Value = myGrade
                                myDist = CDbl(Worksheets("Controls").Range(myHCell))
                                mytemp = (myGrade * myDist) / percentage
    I have declared both myGrade, mytemp, and percentage as double. mytemp still gives me the wrong figure.

    I have checked it by going steps by steps thru the line of code. I got both myGrade and myDist showing the right figure. for example
    myGrade is 1.2 (from calculation)
    myDist is 108.5 (from calculation)
    percentage = 100 (user defined)... i have tried to define percentage to be 100.0 but it changes itself to 100#. (don't know why)
    and mytemp shows 85, instead of 84.90

    Is there a way of getting around this problem in excel? because the work i'm working on require very accurate figures.

    Thank you in advance
    Not quite suure what I am reading incorrectly here, but 1.2 * 1.08 doesn't make 85 on my pc,

    mytemp = (myGrade * myDist) / percentage

    mytemp = 1.2 * 108.5 / 100

    (note the 100# doesn't seem to affect, dropped into a Range~.value appears ok)

    Can you clarify the 'mytemp' calculation?
    ---
    Si fractum non sit, noli id reficere.

+ 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