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
Bookmarks