Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. 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: Finding the Address of the Lowest Value in a Range.

# Finding the Address of the Lowest Value in a Range

by Allen Wyatt
(last updated July 2, 2018)

When writing a macro, you can find the lowest value in a range of cells by using the WorksheetFunction method to apply the MIN worksheet function. You may need, however, to not only find the lowest value in the range, but also the address of the first cell that contains that value.

One simple way is to simply step through the range you want to examine and derive both the lowest value and the address of the cell being examined, as in the following:

```Function FindLowestAddr(pRng As Range) As String
Application.Volatile
MinVal = pRng.Cells(1).Value
For Each c in pRng
If c.Value < MinVal Then
MinVal = c.Value
End If
Next c
End Function
```

Note that this approach doesn't rely upon the MIN worksheet function at all. There is a drawback to it, however—it doesn't differentiate between cells that contain numeric values and those that don't. In other words, if the range passed to the function contains a blank cell, that cell is considered to contain a zero value, which may very well be the lowest value in the range.

One way around this is to rely upon worksheet functions from within the macro. The following macro uses both the MIN and MATCH worksheet functions to determine the location of the minimum value and then the index (offset) of that cell within the range.

```Function GetAddr(rng As Range) As String
Dim dMin As Double
Dim lIndex As Long

Application.Volatile
With Application.WorksheetFunction
dMin = .Min(rng)
lIndex = .Match(dMin, rng, 0)
End With
End Function
```

It should be noted that if you are using the macro only to discover the address because you figured there was no way to derive the desired information without the macro, then you can do away with the macro entirely by using a worksheet formula. For instance, if you want to determine the address of the lowest-valued cell in the named range MyRange, you could use the following:

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12744) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Finding the Address of the Lowest Value in a Range.

##### 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

Changing the Height of Worksheet Tabs

Do you need your worksheet tabs to be taller than what they are? You can't make the adjustment in Excel, but you can make ...

Discover More

If you use UNC paths in your links to external information, those paths may need to be changed at some point. You can ...

Discover More

Repeating Column Information on Each Page

When your table occupies lots of pages, you may want to have information in a particular column repeated on each page. ...

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)

Applying Range Names to Formulas

If you define your named ranges after you create your formulas, you can have Excel update those formulas to reflect the ...

Discover More

Criteria-Based Counting in a Filtered Column

The filtering capabilities of Excel are excellent, providing you with great control over which records in a worksheet are ...

Discover More

Number of Terms in a Formula

Formulas are made up of operands that separate a series of terms acted upon by the operands. You may want to know, for ...

Discover More
##### Subscribe

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

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}] 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 6?

2018-01-01 11:19:10

Ron

I tried the worksheet formulas (one shown and Bryan's) and they work fine if the range is only in one column or one row. What if your range is a block of cells?

2013-11-25 08:29:07

Bryan

Neither macro should be volatile.

As for the worksheet version, you should ask yourself why you actually need the address, instead of a cell reference. If the address just gets fed into an INDIRECT function... you are doing it wrong.

If you actually do need to display the cell address, however, I think the following formula is more clear as to what is going on, as there's no addition or subtraction:

Since the INDEX/MATCH combination actually provides a cell reference and not the cell value, it can be used as an input to the CELL function.

Note, also, that none of these macros and formulas take into account the possibility of multiple minimum values (ties). You will have to decide based on what you are doing how to handle those types of results.

##### 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.