What is the LCM function?
=LCM(number1, [number2], ...)LCM returns the least common multiple: the smallest number that is a multiple of all the numbers.
According to Microsoft, decimals are truncated, and any value below 0 returns #NUM!.
LCM finds when events with different cycles line up, or the common denominator of fractions. When two gears with different tooth counts are back in their starting position, or when machines on different inspection cycles fall on the same day, the least common multiple gives the answer.
Arguments
- number1, number2, ...
- From 1 to 255 integers.
LCM examples
Example 1. 5 and 2
=LCM(5, 2)An example from Microsoft: 10.
Example 2. 24 and 36
=LCM(24, 36)72.
Example 3. Matching cycles
=LCM(3, 4)Tasks every 3 days and every 4 days line up every 12 days.
Example 4. When cycles line up
=LCM(A2, B2)The two cycles meet every LCM steps.
A2 B2 =LCM(A2,B2) Meaning 3 4 12 Every-3-day and every-4-day jobs meet every 12 days 12 18 36 Gears with 12 and 18 teeth realign after 36 teeth 4 6 12 Common denominator of 1/4 and 1/6 Example 5. The next day they meet
=A2+LCM(3, 4)From a day A2 when both jobs ran, the next shared day is 12 days later.
Common mistakes
Negative numbers
They return #NUM!.
Decimals
2.9 is used as 2. It is truncated, not rounded.
Cycles that start on different days
If both jobs ran on the start day, the next match is LCM days later. If they started on different days, LCM alone does not answer it.
FAQ
- Common denominators?
- The LCM of two denominators is the common denominator.
- Can I use a range?
- Yes, for example =LCM(A2:A10).
- More than two numbers?
- Yes. =LCM(2, 3, 4) is 12.