+ Reply to Thread
Results 1 to 9 of 9

return cell address

Hybrid View

  1. #1
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Find address from multiple rows or columns

    Quote Originally Posted by missing
    help
    This site will help
    http://support.microsoft.com/kb/213375

    the code below is what you want
    Function MinAddress(The_Range)
    
       ' Sets variable equal to minimum value in the input range.
       MinNum = Application.Min(The_Range)
       ' Loop to check each cell in the input range to see if equals the
       ' min variable.
       For Each cell In The_Range
          If cell = MinNum Then
             ' If the cell value equals the max variable it
             ' returns the address to the function and exits the loop
             MinAddress = cell.Address
             Exit For
          End If
       Next cell
    
    End Function
    hit alt F11 then insert,module, copy and paste the code there
    next use the formula
    =minaddress(A1:C3)
    to get the address of the min value of that range

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,700
    This formula will give you the address in the format $B$3. If there are 2 or more values tied for MIN then it looks at rows before columns so if A2 and B1 were tied for the minimum it gives B1.

    =ADDRESS(MIN(IF(MIN(A1:C3)=A1:C3,ROW(A1:C3)-ROW(A1)+1)),MATCH(MIN(A1:C3),INDEX(A1:C3,MIN(IF( MIN(A1:C3)=A1:C3,ROW(A1:C3)-ROW(A1)+1)),0),0))

    confirmed with CTRL+SHIFT+ENTER

    You can do it more easily if you can guarantee the the min value occurs only once?

    What do you need this for? Often people get the address as a step on the way to do something else, if that's true for you then I'd advise you not to do it this way......

  3. #3
    Registered User
    Join Date
    09-21-2006
    Posts
    32
    i don't know what i do wrong So i attach a file. Can you look it?
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    03-14-2006
    Location
    Pakistan
    Posts
    1,791

    Lightbulb

    Quote Originally Posted by missing
    i don't know what i do wrong So i attach a file. Can you look it?
    Try using formula provided by dadylonglegs and make sure that you hit CTR+SHIFT+ENTER not just ENTER.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1