+ Reply to Thread
Results 1 to 3 of 3

vba help pls - find min based on a condition and return val of an offset cell

  1. #1
    Impakt
    Guest

    vba help pls - find min based on a condition and return val of an offset cell

    Hi all,

    I need vba code that will say:

    Find the minimum value in col M that is in the same row as the
    condition "Male" (col C), then return the value (text) from col A in
    that row. EG:

    A C M
    Name Division Time

    Joe Male 00:05:23
    Sue Female 00:06:36
    Tom Male 00:04:56
    Tim Open 00:04:33

    The correct information to return in this example would be "Tom". I
    need to have "Tom" appear as a lable.caption in a form. I need to be
    able to code it so that it can find the minimum value for each
    division (the winner of a race).

    Any help greatly appreciated.

  2. #2
    Vasant Nanavati
    Guest

    Re: vba help pls - find min based on a condition and return val of an offset cell

    Something like:

    =INDEX(A2:A10,MATCH(MIN(IF(C2:C10="Male",M2:M10)),M2:M10,0))

    entered as an array formula with <Ctrl> <Shift> <Enter>.

    --

    Vasant

    "Impakt" <[email protected]> wrote in message
    news:[email protected]...
    > Hi all,
    >
    > I need vba code that will say:
    >
    > Find the minimum value in col M that is in the same row as the
    > condition "Male" (col C), then return the value (text) from col A in
    > that row. EG:
    >
    > A C M
    > Name Division Time
    >
    > Joe Male 00:05:23
    > Sue Female 00:06:36
    > Tom Male 00:04:56
    > Tim Open 00:04:33
    >
    > The correct information to return in this example would be "Tom". I
    > need to have "Tom" appear as a lable.caption in a form. I need to be
    > able to code it so that it can find the minimum value for each
    > division (the winner of a race).
    >
    > Any help greatly appreciated.




  3. #3
    Impakt
    Guest

    Re: vba help pls - find min based on a condition and return val of an offset cell

    On Mon, 16 May 2005 11:11:47 -0400, "Vasant Nanavati" <vasantn *AT*
    aol *DOT* com> wrote:

    >Something like:
    >
    >=INDEX(A2:A10,MATCH(MIN(IF(C2:C10="Male",M2:M10)),M2:M10,0))
    >
    >entered as an array formula with <Ctrl> <Shift> <Enter>.
    >
    >--
    >
    >Vasant


    Thanks..I will play with that for a while.

+ 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