dasdasd
dasdasd

Reputation: 2031

Round number to specific multiply

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

Answers (2)

Gary's Student
Gary's Student

Reputation: 96753

Without VBA, you can use the MROUND() worksheet function:

enter image description here

Upvotes: 2

Verkade89
Verkade89

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

Related Questions