Contact

LCM Function (Gnumeric)

Math Beginner Gnumeric

Find a common integer period with Gnumeric LCM, including truncation, ignored text and the zero-input error.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

LCM returns the least positive common multiple of included integers. It can determine when cycles beginning together next align or provide a common integer denominator. Gnumeric 1.12.57 rejects zero, so another application’s zero convention should not be assumed.

Supply positive integer arguments or ranges. Ordinary positive fractions are truncated, while text, logical values and blanks are ignored. Values below one after truncation, negative inputs and empty numeric collections fail the selected contract. Floating-point precision limits mean this is not arbitrary-size exact integer arithmetic.

Syntax

LCM(number1, [number2], ...)

Worked examples

The original =LCM(4,6) returns 12. Events repeating every four and six minutes from a common start next coincide at minute twelve. LCM does not encode different starting offsets.

LCM(4.9,6.9) is twelve after truncation, and LCM(1,6) is six. LCM(0,6) and LCM(-2,6) return #NUM!. With A1=12, A2=18, A3=text, A4=TRUE and A5 empty, LCM(A1:A5) returns 36. LCM(“4”,TRUE) produces #NUM! because its inputs are ignored.

Formula Expected output
=LCM(4,6) 12
=LCM(4.9,6.9) 12
=LCM(0,6) #NUM!
=LCM(-2,6) #NUM!
=LCM(A1:A5) 36
=LCM(1,6) 6
=LCM("4",TRUE) #NUM!

Advanced use

For fractions with denominators four and six, the common denominator twelve requires scaling the respective numerators by three and two. LCM does not perform those numerator adjustments automatically.

The identity a*b/GCD(a,b) explains a small positive-integer case. Multiplying first can lose precision or overflow for large values, so it is not a guarantee of a safer handwritten implementation. For fractional durations, choose a shared integer unit before applying LCM rather than relying on truncation.

Errors and troubleshooting

The tested zero-input error is not a period of zero. Numeric text can be ignored rather than used as a period, and inconsistent units can give a plausible but irrelevant result. Verify shared start time and period units before interpreting a scheduling calculation. Large integer limits are not certified by these examples.

Availability and verification

  • Introduced: Documented by 1.12.62; original introduction not established.
  • Historical source availability: Supported in Gnumeric 1.12.62, based on the function-specific registration.
  • Scope: Desktop; the fn-math function module must be included and enabled.
  • Historical check: October 14, 2026. Documentation/source check; no new native test in Gnumeric 1.12.62.

The selected examples and error cases were recalculated with the actual Gnumeric 1.12.57 engine under C.UTF-8 on 17 October 2026. Native workbooks and observed outputs are retained. Historical 1.12.62 registration is a separate source check, not a native runtime test. The selected example below is GUI-verified; retirement and the last functioning release remain unverified.

For the operations discussed above, see GCD.

ABS ROUND ROUNDUP ROUNDDOWN MOD.

Native application screenshot

The selected cell B1 contains =LCM(A1:A5) and displays 36. The selected example uses the tutorial inputs described above. The documented mixed range occupies A1:A5, with A5 left truly blank; the result is shown in B1. Only this selected example is GUI-verified; the other checks retain their stated engine-test scope.

Gnumeric LCM selected formula and native result

Actual Gnumeric 1.12.57 application, captured 17 October 2026. GUI locale was not independently recorded.

Official references