Thread: Max
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Andrew Taylor Andrew Taylor is offline
external usenet poster
 
Posts: 225
Default Max

You can do this of thing without VBA, though it helps to have a few
extra columns for your working. Assuming your list starts in A1:

In C1: =RANK(B1,$B$1:$B$5) and copy down

this gives 2 for Cats & Birds so we have to modify it:

in D1: =C1+COUNTIF($C$1:C1,C1)-1 and copy down

this makes the second 2 (for birds) into a 3, because there's
a previous occurence of 2, so the COUNTIF is 2 rather than
the usual 1.

Then
=INDEX($A$1:$A$5,MATCH(1,$D$1:$D$5,0)) gives Mice,
=INDEX($A$1:$A$5,MATCH(2,$D$1:$D$5,0)) give Cats
=INDEX($A$1:$A$5,MATCH(3,$D$1:$D$5,0)) give Birds



Darin Kramer wrote:
Hi There,

2 columns , A and B (A with animals, B with number of animals)

Cats 3
Dogs 2
Mice 6
Birds 3
Lions 0


I want the MAX three numbers - forumlae to do this is LARGE(B1:b5,{1})
(and similiar large... {2}... large {3} In the above eg gives a 6 as a
result) but how do I then translate that 6 into its description, ie
mice???
Vlookup wont work because you may have 2 hits, eg Cats and birds both
have 3 hits

Hope this isnt too confusing....

Thanks!!!

D

*** Sent via Developersdex http://www.developersdex.com ***