softweave
softweave

Reputation: 1545

Excel conditional rounding of division remainder

I am building a sheet that calculates fractional quantities from preset values. The results need to be either whole numbers or have a remainder of 0.5. For example, a value of 5 will result in 2.5 for half quantities and 1 for quarter quantities.

I want to round the quantity remainder to 0.5 if a division remainder is greater than 0.25 or less than 0.75, but otherwise round to whole numbers. How do I set up such a formula?

Upvotes: 0

Views: 75

Answers (1)

M.Sqrl
M.Sqrl

Reputation: 416

With a formula and a little math trickery.

=MROUND(A1*10,5)/10

Example

Upvotes: 1

Related Questions