+ Reply to Thread
Results 1 to 9 of 9

return cell address

Hybrid View

  1. #1
    Registered User
    Join Date
    09-21-2006
    Posts
    32

    return cell address

    Hello, i have a problem. I need to return cell address of MIN value:
    example:

    A B C
    1 5 2 7
    2 4 9 3
    3 10 1 5

    Result = B3

    My function:

    =ADDRESS(MIN(IF(A1:C3=MIN(A1:C3),ROW(A1:C3);""));COLUMN(A1:C3))

    it return #VALUE

    Where is a mistake?

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524
    Address Of First Minimum In A Range

    To return the address of the cell containing the first (or only) instance of the minimum of a list,
    use the following array formula:

    =ADDRESS(MIN(IF(NumRange=MIN(NumRange),ROW(NumRange))),COLUMN(NumRange),4)

    This function returns B2, the address of the first '1' in the range.

    http://www.cpearson.com/excel/excelF.htm

    this is an array formula you will be required to
    press ctrl shift enter ( instead of just enter)
    to execute it, don't know if it works for various columns though

  3. #3
    Registered User
    Join Date
    09-21-2006
    Posts
    32
    so i wrote
    =ADDRESS(MIN(IF(NumRange=MIN(NumRange);ROW(NumRang e)));COLUMN(NumRange),4)

    and result=#NAME

    if i wrote
    =ADDRESS(MIN(IF(A1:C3=MIN(A1:C3);ROW(A1:C3)));COLUMN(A1:C3),4)
    result=#VALUE

    what i do wrong?

  4. #4
    Registered User
    Join Date
    09-21-2006
    Posts
    32
    help

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

    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

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699
    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......

  7. #7
    Registered User
    Join Date
    09-21-2006
    Posts
    32
    Thanx a lot

+ 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