Quantcast

Okay Excel junkies...

urbaindk

The Real Dr. Science
Jul 12, 2004
4,819
0
Sleepy Hollar
Help me out!

Say I have 2 columns of data, x and y. I want to find the minimum value of y and its corresponding x location. How do I do that?

The minimum of y is easy. It's corresponding x value seems to be tricky.


Thanks!
 

binary visions

The voice of reason
Jun 13, 2002
22,162
1,261
NC
Easy.

Code:
=LOOKUP(MIN(Y1:Y100),Y1:Y100,X1:X100)
LOOKUP is given in the form LOOKUP(value to find,cells to search in,cells to return value from). Replace those Y and X values with your particular sections of cells, of course.

:thumb: (damn that missing smilie)
 

binary visions

The voice of reason
Jun 13, 2002
22,162
1,261
NC
Hrm... Try doing a manual call. That is, take one of the values you know exists, and do a lookup in a small section around that value. For instance, if Y50 is "123", do =LOOKUP(123,Y45:Y55,X45:X55)
 

urbaindk

The Real Dr. Science
Jul 12, 2004
4,819
0
Sleepy Hollar
Hey BV,

I'm pretty sure my Excel is retarded. It fails on a simple parabolic function y = x^2+x+1. Try finding the min of y and it's location in x for y=x^2+x+1 between -1<x<1 with a step size of dx = 0.1.

The answer is ymin = 0.75 @ x=-0.5. Excel gives x as #N/A. . What gives?
 

urbaindk

The Real Dr. Science
Jul 12, 2004
4,819
0
Sleepy Hollar
Hrm... Try doing a manual call. That is, take one of the values you know exists, and do a lookup in a small section around that value. For instance, if Y50 is "123", do =LOOKUP(123,Y45:Y55,X45:X55)
That seems to work but it isn't all that useful if you have 1000+ points of data to sift through.... Where's a good :going blind: icon?


Edit: The range has to be pretty small too!
 

binary visions

The voice of reason
Jun 13, 2002
22,162
1,261
NC
The reason I suggested you try a small section is because that validates the formula so at least you know that's not the source of error.

If you're getting an error in the formula, and an error in your other function, it sounds like you have some bad data somewhere. Try glancing through your data tables to make sure your data hasn't gone screwy somewhere. For the parabolic function, make sure your data columns are formatted as numerics, not text or anything.
 

urbaindk

The Real Dr. Science
Jul 12, 2004
4,819
0
Sleepy Hollar
The reason I suggested you try a small section is because that validates the formula so at least you know that's not the source of error.

If you're getting an error in the formula, and an error in your other function, it sounds like you have some bad data somewhere. Try glancing through your data tables to make sure your data hasn't gone screwy somewhere. For the parabolic function, make sure your data columns are formatted as numerics, not text or anything.

Nope it's not the data or the formatting. Excel is nuts.

Lookup doesn't work.
Vlookup doesn't work either.

Match does work. "=MATCH(MIN(Y:Y),Y:Y,0)" will return the row number of my minimum value just fine even in my giant data file. That blows the funky data theory out of the water.
 

binary visions

The voice of reason
Jun 13, 2002
22,162
1,261
NC
Sorry I wasn't online much last night or this morning, forgot to check back in on this thread and see where you stood.

Lots of Excel functions require sorting, but that's not so bad considering how easy sorting everything is. Glad you got it taken care of.