Reputation: 2031
I want to round a number to the nearest multiple of 2.5.
For example:
5.5 -> 5
2.8 -> 2.5
8.21 -> 7.5
9.0 - > 10
How do I do it in Excel?
Upvotes: 0
Views: 384
Reputation: 96753
Without VBA, you can use the MROUND() worksheet function:
Upvotes: 2
Reputation: 393
Sub Macro()
Dim row As Integer
For row = 1 To 4
Cells(row, 2) = Math.Round(Cells(row, 1) / 2.5) * 2.5
Next
End Sub
I've placed your numbers in first column, and received the output in the second column, by the code above. What you are looking for is:
Math.Round(someNumber / 2.5) * 2.5
Upvotes: 1