+ Reply to Thread
Results 1 to 7 of 7

find min in one row return value from another

Hybrid View

  1. #1
    Registered User
    Join Date
    12-31-2005
    Location
    Atkins, Arkansas
    MS-Off Ver
    2013
    Posts
    63

    find min in one row return value from another

    I would like to find the minimum of my numbers in row 2 and return the value from row 1 that is in the same column as the minimum number.

    Ex.

    A B C D E F G
    R1 9 8 7 6 5 4 3
    R2 5 3 4 7 1 2 6

    So my formula would need to look at R2 find one and return 5. Is that possible?

    Thanks,

    Josh

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =INDEX($A$1:$H$1,MATCH(MIN($A$2:$H$2),$A$2:$H$2,0))

    Note. If more than one min it will return the first result

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    12-31-2005
    Location
    Atkins, Arkansas
    MS-Off Ver
    2013
    Posts
    63
    Worked great. I edited it to where if any of the cells are blank or zero it will not use them. Here is the edited

    {=INDEX($B$23:$K$23,MATCH(MIN(IF(B29:K29>0,B29:K29)),B29:K29,0))}

    Thanks very much


    Josh

  4. #4
    Registered User
    Join Date
    05-27-2007
    Location
    Lake Arrowhead, CA
    Posts
    2
    Josh,
    I found this forum and your post was at the top of the list when I logged on. This was exactly what I was looking for! But I can't get it to work, it still returns zero if a cell is blank

    =INDEX($C$6:$E$6,MATCH(MIN(IF(C22:E22>0,C22:E22)),C22:E22,0))

    any idea what I'm doing wrong?

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    The formula needs to be confirmed with CTRL+SHIFT+ENTER

    To do that select cell with formula, press F2, hold down CTRL and SHIFT keys and then press ENTER so that curly braces like { and } appear around the formula in the formula bar.

  6. #6
    Registered User
    Join Date
    05-27-2007
    Location
    Lake Arrowhead, CA
    Posts
    2
    Daddylonlegs,
    Thanks, that did it. I have never heard of confirming a formula before.

    I had figured out a different way to get it to work;

    =INDEX(C6:E6,MATCH(SMALL(C22:E22,COUNTIF(C22:E22,0)+1),C22:E22,0))

    I didn't need to confirm it that way, whats the diference?

+ 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