Returning the Minimum of Integers of a Range

Written by Allen Wyatt (last updated May 7, 2022)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


Alec has a range of cells that can contain both integer (23) and decimal (23.4) values. He needs a formula that will return the minimum value of only the integers within the range. Any decimal number within the range should be ignored by the formula completely. It needs to be a formula; a macro would not be viable for Alec's needs.

If you don't mind using a helper column, you could easily figure out if the value is an interger or not. All you need to do is use a formula such as this in the helper column:

=IF(A1=INT(A1),A1,"")

What you end up with is only the integers, with decimal values replaced by blanks. You can then use the MIN function on the helper column to determine the minimum of those integer values.

If you cannot use a helper column, then the best way to go is with an array formula. Assume, for a moment, that your range of cells is A1:A100. You could use either of the following formulas:

=MIN(IF(INT(A1:A100)=A1:A100,A1:A100))

Remember that this is an array formula. This means that you should not enter it by pressing Enter, but should instead use Ctrl+Shift+Enter.

If you prefer to not use array formulas and you are using Excel 2010 or a later version, then you could use a formula based on the AGGREGATE function:

=AGGREGATE(15,6,A1:A100/(A1:A100=INT(A1:A100)),1)

The various parameters possible to use with the AGGREGATE function are too many to list here, but in this the case the first parameter (15) indicates you want the SMALL function applied, the second parameter (6) indicates you want error values ignored, the third parameter is the array to evaluate, and the fourth parameter (1) indicates we want the first result for SMALL returned.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (655) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Printing Styles in a Macro

There may be times when you want your macro to print out a list of styles in the document. If so, then you can do it with ...

Discover More

Making Banners in Word

Word can be used for printing a variety of document types. You may want to use the program to print a festive banner for ...

Discover More

Jumping to the End of the Document in Error

If you inadvertently move to the end of the document, you might be wondering how to get your insertion point back to ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Determining a State from an Area Code

Want to be able to take information that is in one cell and match it to data that is contained in a table within a ...

Discover More

Keeping a Max Value in a Cell

Sometimes it is helpful to have a cell contain the maximum value that has ever occurred within changing data. This tip ...

Discover More

Saving Common Formulas

Got some formulas you slaved over and want to use in lots of workbooks? This tip presents some helpful ideas on how you ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is one less than 9?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

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.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.