1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Finding the minimum in an excel array

Discussion in 'Business Applications' started by JoeHart, Dec 28, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. JoeHart

    JoeHart Thread Starter

    Joined:
    Aug 17, 2008
    Messages:
    125
    Code:
       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
    
     

    Attached Files:

    • 0-6.xls
      File size:
      15.5 KB
      Views:
      51
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Joe, why not just sort the data using column B ascending, which will always put the minimum value in B25?
     
  3. JoeHart

    JoeHart Thread Starter

    Joined:
    Aug 17, 2008
    Messages:
    125
     
  4. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Are you sorting all the data based on column B?
    You can't just sort column b, it has to be all the data selected. You can have a hidden column with the original sort sequence if you want to put it back as it was after.
     
  5. JoeHart

    JoeHart Thread Starter

    Joined:
    Aug 17, 2008
    Messages:
    125
    Yes, if you look at the spreadsheet I attached their are blank in the B column with line up with the limiting element or L. These items don't sort correctly. This seems to be a lot harder than I originally thought. Sorting it does what I need but I have to do a little extra work after it is done. I guess I can write a formula in the next column so that the Limiting Element stays in line with the other two variables. So G28 would equal F27, I guess that would work.

    Thanks again for your help,
    Joe
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/971264

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice