Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Determining the Least Common Multiple.
by Allen Wyatt
(last updated November 3, 2018)
Remember your junior-high math classes? The teacher would write three or four numbers on the chalkboard and ask you to determine what larger number each of the numbers on the board could be a factor of. For instance, if the numbers were 2, 3,and 4, then they are all factors of the number 12. Thus, 12 is the least common multiple of those three numbers.
Things got really difficult when the teacher threw up six, seven, or ten numbers. Yikes! Fortunately, Excel makes calculating the least common multiple rather easy. All you need to do is put the numbers in a range of cells, and then use a formula like this:
In just a jiffy Excel returns a value that, sure enough, would have made that math teacher proud.
Just one gotcha here: If you use non-integer values with the LCM function, everything past the decimal point is ignored. In other words, the values are truncated before LCM does its magic. So, the bottom line is to make sure you are working with actual integers with LCM.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (5833) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Office 365. You can find a version of this tip for the older menu interface of Excel here: Determining the Least Common Multiple.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
When you need to count a number of cells based upon a single criteria, the standard function to use is COUNTIF. This tip ...Discover More
Ever want the IF function to only return a value if the condition it is testing is true, and not if the condition is ...Discover More
When working with text in a formula, you may need to extract the left-most characters from a string of text or from a ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.