View Single Post
  #5   Report Post  
automandc
 
Posts: n/a
Default

Thanks to all who responded so far. Each of your proposed solutions offers
promise, and I will use them to build a final solution.

Peo's solution is the most on-point (actually finding the address of the
resulting cell), but it is so bulky that I fear it will seriously choke in a
sheet with 50,000+ instances of the formula. He also points up the problem
with using "LARGE": failure to properly handle identical values.

The info on David's page is great, and will help me solve a lot of problems
I run across when tinkering in Excel.

Harlan's solution is perhaps less elegant (no offense), but it is what I am
currently doing -- only I've been doing it manually with cut-and-paste to put
the data into one column. (First I create a second set of columns that
contain a string of the data point cat'ed with the header description, then
seperate them back into two separate columns after combining into a single
column list). Harlan's method will allow me to programatically create the
unified list I am currently doing manually and skip the step of
double-conversion. Of course, it has the drawback of quickly running up
against the 65K row limit for tables that get big.

It would ultimately be nice if you could do something like this:

=Large&(data_range,n)

and get a pointer to the result (e.g. a reference), instead of having word
actually resolve the result. This would be kind of like a reverse-INDIRECT
function.

Sometimes I really wish there was a way to do loops directly in the
worksheets (like a FOR..NEXT loop), and have it fill in a range with the
results.

Anyway, thanks again everyone -- the MSDN forums always come through for me.

Tobias

"automandc" wrote:

Is there a way to retrieve the reference to a Statistical/Math function
result, rather than the actual result?

I have a large table (R1150 X C50) with numeric values in each cell. I want
to put all of the data into numerical order, but retain the name of the
column each data point came from.

Let's say the table is at A1:Z1000. I can use the LARGE function to choose
the nth largest value with LARGE($A$1:$Z$1000,n). Make "n" a reference to a
series in an adjoining column, and it is easy to create a one-dimensional
list of the top n values. However, there is no way to associate each value
back to the table for the purpose of finding the column it came from.
Neither VLOOKUP nor HLOOKUP will work, since the value could come from any
column or row in the 2D table.

It seems that if LARGE goes out there and evaluates all of the datapoints to
determine the nth largest, it ought to be able to tell me where it got that
datapoint from.

So, is there a way to extract the reference rather than the result from a
function like "LARGE"? (this would also apply to any function that singles
out a specific value from an array, such as "MIN", "MAX"; but not calculation
functions like "AVERAGE").