Skip to main content

MROUND

Returns a number rounded to the desired multiple.

Syntax

expression.MROUND(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe value to round.
arg2RequiredApiRange | ApiName | numberThe multiple to round the number to.

Returns

number

Example

Round a number to the nearest multiple of another value in a spreadsheet.

// What is a number rounded to a specific multiple in a spreadsheet?

// Adjust a value to the closest increment in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.MROUND(14.35, 0.4));