Round a price in A2 to the nearest 5 cents, and a quantity in B2 to the nearest 5 units

公式

=MROUND(A2, 0.05)

说明

MROUND rounds to the nearest multiple of the second argument. Use ROUNDUP/ROUNDDOWN when you must always go away from or toward zero.

步骤

  1. MROUND(value, 0.05) snaps to nickel increments.
  2. MROUND(value, 5) snaps to multiples of 5.
  3. Enable the Analysis ToolPak in very old Excel if MROUND is missing.

变体

Always round up to 0.05

Common for tax-inclusive price display.

=CEILING(A2, 0.05)

Always round down to 5

Pack sizes that cannot be partial.

=FLOOR(B2, 5)

Classic ROUND equivalent

Works everywhere, including WPS, without MROUND.

=ROUND(A2/0.05, 0)*0.05