VBA uses bankers rounding in an attempt to compensate for the bias in always rounding up or down on .5; you can instead;
WorksheetFunction.Round(cells(1,1).value * cells(1,2).value, 2)
Answer from Alex K. on Stack OverflowHow to round up with excel VBA round()? - Stack Overflow
excel - VBA - How to Round values in Range with `With` statement - Stack Overflow
Rounding in Excel VBA
Round a range of cells using VBA
Videos
VBA uses bankers rounding in an attempt to compensate for the bias in always rounding up or down on .5; you can instead;
WorksheetFunction.Round(cells(1,1).value * cells(1,2).value, 2)
If you want to round up, use half adjusting. Add 0.5 to the number to be rounded up and use the INT() function.
answer = INT(x + 0.5)
As we should all know, Excel VBA function ROUND doesn't round like we were taught in grammar school. It does banker's rounding (e.g, .5 rounds to 0, 1.5 rounds to 2, 2.5 rounds to 2, etc.).
This site suggests a routine you can implement to make your numbers round like everybody else expects.
I looked at what it does and it seems wayyyyyy too complicated for what needs to be done. Seems. It looks to me like all their code could be reduced to one line:
StandardRound = Round(CDbl(CStr(pValue) & "1"), pDecimalPlaces)
Does my routine need to be more complicated for reasons I'm not comprehending?
Edit: Answer: YES! But I love a good discussion, so at the cost of feeling inadequate, I got one. Small price to pay!
It's simple math. Given a number X and a rounding factor N, the formula would be:
round(X / N)*N
Integrated Answer
X = 1234 'number to round
N = 5 'rounding factor
round(X/N)*N 'result is 1235
For floating point to integer, 1234.564 to 1235, (this is VB specific, most other languages simply truncate) do:
int(1234.564) 'result is 1235
Beware: VB uses Bankers Rounding, to the nearest even number, which can be surprising if you're not aware of it:
msgbox round(1.5) 'result to 2
msgbox round(2.5) 'yes, result to 2 too
Thank you everyone.