Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Getting corresponding test value to a MIN function

I have a sheet that looks something like this...

Supplier Price Low Price Supplier Low Price
Jimmy's Widgets 10 7
Widget World 45
Widget Discount 7
Widget's R Us 35565

I am able to get "7" to come up as my low price with this function...
=MIN(B2:B5) but I want the name of the corresponding supplier to appear under
"Low Price Supplier". I have tried various combinations of IF, MATCH, etc.
with no success.

Help Please!!

Thanks,

Chris the excel peon
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Getting corresponding test value to a MIN function

Here is one way to do it (maybe not the best, but it worked for my test:)
Create a function like so:
Function myLookup(myInt As Integer, myRng As Range) As String
For Each cell In myRng
If myInt = cell.Value Then
myLookup = cell.Offset(, -1).Value
Exit For
End If
Next cell
End Function
And then in the worksheet, enter a formula like so:
=mylookup(D1,B1:B4) where d1 is the low price value you are looking up and
b1:b4 is where the Price is. Change types as necessary (from the data given,
it looked like Integer would work for the test.) Or if you were looking for
max, you could change it to long.


"confused_chris" wrote:

I have a sheet that looks something like this...

Supplier Price Low Price Supplier Low Price
Jimmy's Widgets 10 7
Widget World 45
Widget Discount 7
Widget's R Us 35565

I am able to get "7" to come up as my low price with this function...
=MIN(B2:B5) but I want the name of the corresponding supplier to appear under
"Low Price Supplier". I have tried various combinations of IF, MATCH, etc.
with no success.

Help Please!!

Thanks,

Chris the excel peon

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Getting corresponding test value to a MIN function

=index(a2:a5,match(min(b2:b5),b2:b5,0))



confused_chris wrote:

I have a sheet that looks something like this...

Supplier Price Low Price Supplier Low Price
Jimmy's Widgets 10 7
Widget World 45
Widget Discount 7
Widget's R Us 35565

I am able to get "7" to come up as my low price with this function...
=MIN(B2:B5) but I want the name of the corresponding supplier to appear under
"Low Price Supplier". I have tried various combinations of IF, MATCH, etc.
with no success.

Help Please!!

Thanks,

Chris the excel peon


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Getting corresponding test value to a MIN function

Hey Dave,

Thanks - you're the man! I was a little confused by the first reply but
yours works out very nicely!

Cheers,

"no longer" Confused Chirs



"Dave Peterson" wrote:

=index(a2:a5,match(min(b2:b5),b2:b5,0))



confused_chris wrote:

I have a sheet that looks something like this...

Supplier Price Low Price Supplier Low Price
Jimmy's Widgets 10 7
Widget World 45
Widget Discount 7
Widget's R Us 35565

I am able to get "7" to come up as my low price with this function...
=MIN(B2:B5) but I want the name of the corresponding supplier to appear under
"Low Price Supplier". I have tried various combinations of IF, MATCH, etc.
with no success.

Help Please!!

Thanks,

Chris the excel peon


--

Dave Peterson

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
struggling with if logical test function neuromoe Excel Worksheet Functions 2 June 5th 09 07:27 PM
Can someone test this IF function for me, I'm not sure that it works. dd Excel Worksheet Functions 3 February 22nd 07 08:55 AM
IF Function to test formula in a cell Fred Holmes Excel Worksheet Functions 5 November 18th 05 12:04 AM
Getting corresponding test value to a MIN function Willis in crisis Excel Worksheet Functions 1 November 2nd 05 06:32 PM
Function IF / test / Picture result merlin68 Excel Worksheet Functions 3 April 7th 05 02:56 PM


All times are GMT +1. The time now is 06:49 PM.

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"