Formualizer Docs
ReferenceFunctionsMath Functions

LCM

LCM: Returns the least common multiple of one or more integers.

Summary

LCM truncates fractional arguments toward zero and combines values iteratively.

Remarks

  • Inputs must be non-negative and within the supported Excel-compatible range.
  • If any input is 0, the resulting least common multiple is 0.
  • Any argument error propagates immediately.

Examples

Least common multiple for two integers
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
12
Fractional values are truncated
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
24
Negative values return numeric error
Grid
CellValue
No inputs on Sheet1.
Formula
=
Result
Not evaluated yet.
Expected
#NUM!

FAQ

Why does LCM return 0 when one argument is 0?

LCM is defined as 0 if any truncated input is 0 in this implementation.

Are fractional inputs accepted?

Yes, but they are truncated toward zero before the LCM calculation.

Runtime metadata

Category

Math

Signature

LCM(arg1: Number, arg2…: Number)

Arity

min 1, max variadic

Arguments

arg1

Number · Scalar · coercion NumberLenientText

arg2

Number · Scalar · coercion NumberLenientText

Caps

PURE

Source

On this page