LCM function

LCM returns the least common multiple of two or more positive integers, useful for finding repeating cycles and scheduling overlaps.

=LCM(number1, ...)

Generate a LCM formula

Describe what you need. The generator will reach for LCM where LCM is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How LCM reads its arguments
number1requiredLCM
ArgumentRequiredDescription
number1RequiredA required positive integer. Non-integers are rounded down; zero, negatives, and decimals all produce #NUM!.
...RepeatingOptional additional positive integers. LCM calculates the common multiple across all supplied arguments.

Returns

A positive integer representing the smallest number evenly divisible by all arguments.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Find when assignment cycles from two subjects align

SubjectDays Between Assignments
Math4
Science6
=LCM(4, 6)

Result: 12

Math assignments repeat every 4 days, Science every 6 days. Their cycles both repeat on day 12 (the smallest multiple of both 4 and 6). Teachers can use this to plan coordinated review sessions.

2. Create a unified point scale across three subjects

SubjectAssignment Max Points
Math Quiz50
Science Lab20
English Essay100
=LCM(50, 20, 100)

Result: 100

Different subjects use different maximum point values: Math (50), Science (20), English (100). To normalize grades on a single scale, 100 is the smallest number divisible by all three. Math scores can be scaled by ×2, Science by ×5, and English by ×1.

3. Find when all three subjects schedule assignments on the same day

SubjectAssignment Frequency (Days)
Math3
Science4
English5
=LCM(3, 4, 5)

Result: 60

Math assignments cycle every 3 days, Science every 4, English every 5. All three cycles align on day 60. This helps administrators avoid overloading students with simultaneous assignments.

Common errors

Which LCM error are you seeing?
LCM returned an error#NUM!
Ensure all arguments are positive whole numbers. Use ROUND(), INT(), or ABS() to convert: =LCM(INT(3.5), 8) or =LCM(ABS(-4), 6).
#VALUE!
Verify that all arguments reference cells containing numbers, not labels. Extract the numeric values explicitly: use a column of integers, not subject names.
#REF!
Restore the deleted column or update your formula to reference intact cells. Use explicit numbers instead: =LCM(4, 6) rather than =LCM(A1, B1).
ErrorWhy it happensHow to fix it
#NUM!LCM requires positive integers. Passing zero, negative numbers, or decimals triggers this error: =LCM(-4, 6) or =LCM(3.5, 8).Ensure all arguments are positive whole numbers. Use ROUND(), INT(), or ABS() to convert: =LCM(INT(3.5), 8) or =LCM(ABS(-4), 6).
#VALUE!LCM cannot process text strings. Passing a subject name or text causes this: =LCM("Math", 5) or =LCM(A1) when A1 contains 'Science'.Verify that all arguments reference cells containing numbers, not labels. Extract the numeric values explicitly: use a column of integers, not subject names.
#REF!If you reference cells that are later deleted or moved, LCM breaks. For example: =LCM(A1, B1) where column A is then deleted.Restore the deleted column or update your formula to reference intact cells. Use explicit numbers instead: =LCM(4, 6) rather than =LCM(A1, B1).

Tips and when to use something else

  • LCM works only with positive integers. If your data has decimals (like 3.5-day cycles), round first with INT() or ROUND().
  • Use LCM to solve real scheduling problems: coordinating assignments, aligning test dates, or finding when resource cycles repeat together.
  • For the inverse problem—finding the largest number that divides into multiple values—use GCD (Greatest Common Divisor). To round values to multiples directly, use MROUND().
  • LCM returns large numbers quickly; LCM(12, 15, 20) = 60, but LCM(100, 200, 300) = 600. Always validate results make sense for your context.

Frequently asked questions

Can I use LCM with decimal numbers like 3.5?
No. LCM requires positive integers and will return #NUM! for decimals. Round them first using INT() or ROUND(). For example, =LCM(INT(3.5), 6) converts 3.5 to 3 before calculating.
What's the difference between LCM and GCD?
LCM (Least Common Multiple) finds the smallest number divisible by all inputs. GCD (Greatest Common Divisor) finds the largest number that divides evenly into all inputs. They solve opposite problems: LCM scales up, GCD scales down.
How many arguments can LCM accept?
Most spreadsheet applications support up to 255 arguments in LCM. Practically, 2–10 arguments are typical. Check your platform's documentation for exact limits.
Is LCM useful outside of math class?
Yes. LCM is practical for scheduling (when recurring events overlap), production cycles (when batches from different lines sync), and any system with repeating patterns. Gradebook examples include coordinating assignment due dates and normalizing grades across different point scales.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17