Hard to articulate question =)

  • Thread starter Thread starter Jakanden
  • Start date Start date
J

Jakanden

Hello all,

I am using Excel 2000 and here is the setup.

I have an excel spreadsheet of call times, idles and the like (Cal
center reps) and I have a forumla where the max for a row goes to
location (=MAX(D3:D19)) the min goes to a location (=MIN(G3:G19))
Those work fine.

What I need is the name that is associated with the max or the min t
show up in another cell. basically, if the max of D3:D19 is lets sa
D6, I need the name associate with D6 (Which would be C6) to show up i
another cell.

Is there a forumla/function for this or no? Thanks
 
But note that you could get the wrong info if there are equal values

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel
 
Hi,
Let's say the MAX formula is in F3.
Then to get the name associated with the max value use
=INDEX(C3:C19,MATCH(F3,D3:D19,0))
Since you will want to copy and modify it to get the name for the MIN use
=INDEX($C$3:$C$19,MATCH(F3,$D$3:$D$19,0))
Beware: if there are two equal MAX/MIN you get only the first name.
Best wishes
Bernard
 
Fetching what is associated with the Max (or Min) value is a special case of
Top N problems like building a list of 5 cheapest suppliers. If the 5th
cheapest value is offered by more than 1 supplier, it is obvious that all of
them should be included in the list, not just one. Again, suppose that Bob
and Alice have B on a Math exam and B is the Max grade. Alice wouldn't be
happy to see that just Bob has been listed in a Top 1 list. Niek Otten in
his reply, as I construe it, is alluding to this issue. I published a few
times here and elsewhere a formula system that addresses the Top N problem.

Let C2:D10 house the following sample, including the labels (a smaller
sample size than yours, but that's inessential)...

{"Name","Score";"Damon",33;"Bob",37;"Brian",33;"Jack",28;"Mike",35;"Felicia"
,28;"Alice",37;"Gaz",32}

In E2 enter: Max-Rank (which is just a label).

In E3 enter & copy down:

=RANK(D3,$D$3:$D$10)+COUNTIF($D$3:D3,D3)-1

which produces a ranking in descending order.

In F2 enter: Min-Rank (which is just a label).

In F3 enter & copy down:

=RANK(D3,$D$3:$D$10,1)+COUNTIF($D$3:D3,D3)-1

which produces a ranking in ascending order.

In G2 enter: Max (just a label).

In H2 enter:

=MAX(D3:D10)

In G3...

=MAX(IF(INDEX(D3:D10,MATCH(H3,E3:E10,0))=D3:D10,E3:E10))-H3

which must be confirmed with control+shift+enter instead of just enter.

This formula computes how many values are tied with the Max value (put a bit
precisely: with the Top Nth value).

In H3 enter: 1 (indicates that N = 1).

In G4 enter: Names for Max (just a label).

In G5 enter & copy down:

=IF(ROW()-ROW($G$5)+1<=$H$3+$G$3,INDEX($C$3:$C$10,MATCH(ROW()-ROW($G$5)+1,$E
$3:$E$10,0)),"")

which lists the names associated with the Max value.

Note that the ROW($G$5) bit anchors the formula to the first cell the
formula is entered.

In I2 enter: Min

In J2 enter:

=MIN(D3:D10)

In I3...

=MAX(IF(INDEX(D3:D10,MATCH(J3,E3:E10,0))=D3:D10,E3:E10))-J3

which must be confirmed with control+shift+enter instead of just enter.

In J3 enter: 1

In I4 enter: Names for Min

In I5 enter & copy down:

=IF(ROW()-ROW($G$5)+1<=$I$3+$J$3,INDEX($C$3:$C$10,MATCH(ROW()-ROW($G$5)+1,$F
$3:$F$10,0)),"")

which lists the names associated with the Min value.

The entire data and processing area would now look like this:

{"Name","Score","Max-Rank","Min-Rank","Max",37,"Min",28;
"Damon",33,4,4,1,1,1,1;"Bob",37,1,7,"Names for Max","","Names for Min","";
"Brian",33,5,5,"Bob","","Jack","";
"Jack",28,7,1,"Alice","","Felicia","";
"Mike",35,3,6,"","","","";
"Felicia",28,8,2,"","","","";
"Alice",37,2,8,"","","","";
"Gaz",32,6,3,"","","",""}

If you'd like to receive the workbook showing the above system, just drop an
e-mail.
 
Correction: The formula in I3 should be:

=MAX(IF(INDEX(D3:D10,MATCH(J3,F3:F10,0))=D3:D10,F3:F10))-J3


[...]
In I3...

=MAX(IF(INDEX(D3:D10,MATCH(J3,E3:E10,0))=D3:D10,E3:E10))-J3

which must be confirmed with control+shift+enter instead of just enter.

[...]
 
Back
Top