Lookup function in Excel


A

Anthony

I have a large spreadsheet, and I am attempting to aggregate data contained
in this spreadsheet. Here is what I am trying to do: I have labels across
the top row of the spreasheet. The spreadsheet is set up like this:

ABCDEFG
1 11345
2 12145
3 12341

What I'd like to do is determine for each row, what the minimum value is,
the number of instances the minimum value is achieved, and the corresponding
value for the first row ON THE LAST OCCASION OF THE MINIMUM VALUE going from
left to right. FOr example, if the function I am trying to use were entered
correctly, it would return (for Row 1) a minimum value of 1 that is recorded
on two instances AND the final instance occurs at Column B (top row of
values). Similarly for row 3, my function would return a minimum value of 1
that is recorded on two instances AND the final instance occurs at Column E
(note that in my example above, things might not line up). In any event, any
help would be greatly appreciated.

Many thanks
 
Ad

Advertisements

L

Lars-Åke Aspelin

I have a large spreadsheet, and I am attempting to aggregate data contained
in this spreadsheet. Here is what I am trying to do: I have labels across
the top row of the spreasheet. The spreadsheet is set up like this:

ABCDEFG
1 11345
2 12145
3 12341

What I'd like to do is determine for each row, what the minimum value is,
the number of instances the minimum value is achieved, and the corresponding
value for the first row ON THE LAST OCCASION OF THE MINIMUM VALUE going from
left to right. FOr example, if the function I am trying to use were entered
correctly, it would return (for Row 1) a minimum value of 1 that is recorded
on two instances AND the final instance occurs at Column B (top row of
values). Similarly for row 3, my function would return a minimum value of 1
that is recorded on two instances AND the final instance occurs at Column E
(note that in my example above, things might not line up). In any event, any
help would be greatly appreciated.

Many thanks


Try the following formula

="("&MIN(A1:G1)&","&COUNTIF(A1:G1,MIN(A1:G1))&","&CHAR(64+MAX(COLUMN(A1:G1)*(A1:G1=MIN(A1:G1))))&")"

Note: This is an array formula that should be confirmed with
CTRL+SHIFT+ENTER rather than just ENTER.

Change the range A1:G1 to fit your data range.

The result for you sample data will be
"(1,2,B)" for row
"(1,2,C)" for row 2
"(1,2,E)" for row 3

Maybe you should consider not to have all three results in the same
formula but split it into three different formulas.

Hope this helps / Lars-Åke
 
A

Anthony

I already have the MIN function and the COUNT function allowing me to get the
minimum value and # of instances the value occurs. It is the 3rd task I am
attempting to incorporate, that is match the last instance of the minumum
value with the corresponding value in the top row abov it. How would I do
this?

Again, many thanks!
 
L

Lars-Åke Aspelin

I already have the MIN function and the COUNT function allowing me to get the
minimum value and # of instances the value occurs. It is the 3rd task I am
attempting to incorporate, that is match the last instance of the minumum
value with the corresponding value in the top row abov it. How would I do
this?

Again, many thanks!


Please define "the top row above it". Is "the top row" row number 1?
Or is it the row just above?

In your example, is the A, B, C, D, E, F, and G data or is it just the
normal column headers?

Lars-Åke
 
A

Anthony

Thank you. Sorry for lack of clarification. In my example, it is the
A,B,C,D, etc...not the header.
 
L

Lars-Åke Aspelin

Thank you. Sorry for lack of clarification. In my example, it is the
A,B,C,D, etc...not the header.


Does that mean that 1,2,3 to the left also are just data and not the
row numbers?
Maybe better to use some other data in the example...

So, if this is your table

Alfa Bravo Charlie Delta Echo
data1 1 1 3 4 5
data2 1 2 1 4 5
data3 1 2 3 4 1

try the following formula

=INDEX(A$1:F$1,MAX(COLUMN(B:F)*(B2:F2=MIN(B2:F2))))

For row2, with "data1" it will return "Bravo"
For row3 it will return "Charlie"
For row4 it will return "Echo"

Note: The formula is an array formula that should be confirmed with
CTRL+SHIFT+ENTER rather than just ENTER.

Lars-Åke
 
Ad

Advertisements

A

Anthony

After some tinkering, this worked VERY well. Thank you VERY much. This
saved me hours of work.

Regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top