Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

index, match over three columns 1

Status
Not open for further replies.

glg1

Programmer
Nov 19, 2005
65
US
I've got a vexing problem. A big data set is structured as follows: Name score1 score2 score3 Name2 score 1 score2 ...

Jane 94 88 97 Bob 85 93 75 John 96 93 31
Mary 88 76 85 Jack 96 87 32 Fred 95 99 92
...


I need to be able to get the name of the person with lowest score in the third column of their scores. Hence:
31 John
32 Jack

I'm a bit stuck on Index(match) in that I can't figure out how to move the match to the left three columns.

Cheers
 


Hi,
[tt]
=MIN(A1:L1)
=INDEX(A1:L1,1,(INT((MATCH(MIN(A1:L1),A1:L1,0)-1)/4))*4+1)
[/tt]

Skip,

[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue]
 
Thanks Skip,
It almost worked. I ended up changing the very last +1 to -1 and it moved left 3 columns. With +1 it only moved left 1 column. But I must confess that I don't fully understand what is happening. Help me out:
1. finds the minimum in the row (min(..)
2. matches the minimum to give the location(reference)
3. changes the position to a negative?
4. This is where you loose me.

On the other hand, I was playing with offset(match) - but kept getting an error. Is this another way to solve the same problem?
Thanks,
G
 


My forumlas assume that your data upper l-h cell is A1.
[tt]
=INDEX(A1:L1,1,(INT((MATCH(MIN(A1:L1),A1:L1,0)-1)/4))*4+1)
[/tt]
[tt]
MATCH(MIN(A1:L1),A1:L1,0)
[/tt]
returns the position in A1:L1 where the MIN value is
[tt]
(INT((MATCH(MIN(A1:L1),A1:L1,0)-1)/4))*4+1
[/tt]
Subtract 1 and divide by 4; take the Integer portion and multiply by 4 and add 1 -- this is the position within A1:L1 of a name

Skip,

[glasses] [red]Be Advised![/red]
The band of elderly oriental musicians, known as Ground Cover, is, in reality...
Asian Jasmine![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top