Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return Each Last Non-blank Cell, Value 2 Column Offset, Many GAPS Jim[_14_] Excel Worksheet Functions 1 August 18th 11 06:37 PM
Limitations when Combining OFFSET and MATCH to return a cell refer Danger Mouse Excel Worksheet Functions 1 November 24th 08 12:35 AM
find max value in column and return offset of that value deborah Excel Discussion (Misc queries) 2 March 20th 07 03:48 PM
Fill a cell based on a condition being met confused teacher Excel Worksheet Functions 3 July 5th 06 08:29 AM
test cell for text string; return value if condition is true Steve[_63_] Excel Programming 2 July 8th 04 04:55 AM


All times are GMT +1. The time now is 01:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"