ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vba help pls - find min based on a condition and return val of an offset cell (https://www.excelbanter.com/excel-programming/329459-vba-help-pls-find-min-based-condition-return-val-offset-cell.html)

Impakt

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.

Vasant Nanavati

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" wrote in message
...
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.




Impakt

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.


All times are GMT +1. The time now is 06:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com