Excel function

LCMfunction

Returns the least common multiple of two integers. Decimals use only the integer part.

All versions
=LCM(A2, 4)
A
B
1
2
3
4
5
6
7

Click a cell in the table to change number. Click 15 and set number2 to 6. The least common multiple is 30. Try breaking it on purpose to see the errors.

Result

12

number
A2You can also click a cell in the table

The cell with the number to calculate. Click another value in the table.

number2

The other integer. In Excel you can give up to 255 numbers.

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

  1. Example 1. 5 and 2

    =LCM(5, 2)

    An example from Microsoft: 10.

  2. Example 2. 24 and 36

    =LCM(24, 36)

    72.

  3. Example 3. Matching cycles

    =LCM(3, 4)

    Tasks every 3 days and every 4 days line up every 12 days.

  4. Example 4. When cycles line up

    =LCM(A2, B2)

    The two cycles meet every LCM steps.

    A2B2=LCM(A2,B2)Meaning
    3412Every-3-day and every-4-day jobs meet every 12 days
    121836Gears with 12 and 18 teeth realign after 36 teeth
    4612Common denominator of 1/4 and 1/6
  5. 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

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.