The LCM function in Google Sheets is a powerful tool used to determine the least common multiple of two or more integers. This mathematical function is essential in various fields, including mathematics, engineering, and statistics, allowing users to find the smallest positive integer that is divisible by the given numbers. It’s particularly useful when dealing with problems related to fractions, multiples, and ratios.
Syntax
LCM(number1, [number2, ...])
- number1: The first integer for which the least common multiple is calculated.
- number2: An optional parameter indicating additional integers for the calculation. You can include more integers by adding commas.
Example #1
=LCM(4, 6)
This function call calculates the least common multiple of 4 and 6, resulting in 12, since 12 is the smallest number that is a multiple of both 4 and 6.
Example #2
=LCM(5, 10, 15)
In this example, the function finds the least common multiple of 5, 10, and 15, yielding a result of 30, which is divisible by all three numbers.
Example #3
=LCM(8, 12)
Here, the LCM of 8 and 12 is calculated, giving a result of 24, as it is the smallest integer that both numbers divide into without a remainder.
Error handling
- VALUE!: This error occurs if any of the provided arguments are non-numeric values, indicating that LCM cannot process them.
- NUM!: This error is returned when one or more integers exceed the maximum limit that the function can handle, typically very large integers.