Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Return Three Highest Categories

I would like a formula that returns the three highest categories within a
list. I think an example would be best:

A B
1 Animal Count
2 Dog 3
3 Cow 1
4 Dog 2
5 Cat 5
6 Sheep 2
7 Cat 2
8 Chicken 4

From this list I want to know the top 3 animals, thus the correct answer
would be:

A B
1 Animal Count
2 Cat 7
3 Dog 5
4 Chicken 4

Is there a nifty little (or big) forumla to give me the results in column A?
For what it is worth I am trying to avoid array formulas but if that is the
only way to do it I will live with it.

Thank you,
Eli

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default Return Three Highest Categories

With helper columns
Formula in D1 (copied down) =SUMIF($B$1:$B$7,$B1,$C$1:$C$7)
Formula in E1 (copied down) =B1
Formula in F1 (copied to F2 and F3) =LARGE($D$1:$D$7,1)
Formula in G1 (copied to G2) =COUNTIF($D$1:$D$7,F1)
Formula in H1 (copied to H2 and H3) =VLOOKUP(F1,$D$1:$E$7,2,FALSE)
Formula in I1:I4 =F1



"Eli" wrote:

I would like a formula that returns the three highest categories within a
list. I think an example would be best:

A B
1 Animal Count
2 Dog 3
3 Cow 1
4 Dog 2
5 Cat 5
6 Sheep 2
7 Cat 2
8 Chicken 4

From this list I want to know the top 3 animals, thus the correct answer
would be:

A B
1 Animal Count
2 Cat 7
3 Dog 5
4 Chicken 4

Is there a nifty little (or big) forumla to give me the results in column A?
For what it is worth I am trying to avoid array formulas but if that is the
only way to do it I will live with it.

Thank you,
Eli

  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Return Three Highest Categories

Another play is to pivot your source table, placing "Animal" in the ROW area
and "Count" in the DATA area (set to Sum). Then just select the header
"Animal" in the pivot, click the "PivotTable" dropdown Sort and Top 10 (in
the pivot toolbar), and set the autosort options as desired, viz.: Autosort
Descending, using field: Sum of Count. Up and running in a matter of seconds
...
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:370 Subscribers:68
xdemechanik
---
"Eli" wrote:
I would like a formula that returns the three highest categories within a
list. I think an example would be best:

A B
1 Animal Count
2 Dog 3
3 Cow 1
4 Dog 2
5 Cat 5
6 Sheep 2
7 Cat 2
8 Chicken 4

From this list I want to know the top 3 animals, thus the correct answer
would be:

A B
1 Animal Count
2 Cat 7
3 Dog 5
4 Chicken 4

Is there a nifty little (or big) forumla to give me the results in column A?
For what it is worth I am trying to avoid array formulas but if that is the
only way to do it I will live with it.

Thank you,
Eli

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Return Three Highest Categories

Hi dhstein,

Thanks for the insight, this is exactly what I wanted. I did have to make a
few changes to make this work.

With helper columns
Formula in D1 (copied down) =SUMIF($A$1:$A$7,$A1,$B$1:$B$7)
Formula in E1 (copied down) =A1
Formula in F1 =LARGE($D$1:$D$7,1)
Formula in F2 =LARGE($D$1:$D$7,G1+1)
Formula in F3 =LARGE($D$1:$D$7,sum(G1:G2)+1)
Formula in G1 (copied to G2) =COUNTIF($D$1:$D$7,F1)
Formula in H1 (copied to H2 and H3) =VLOOKUP(F1,$D$1:$E$7,2,FALSE)
Formula in I1:I3 =F1

Cheers,
Eli


"dhstein" wrote:

With helper columns
Formula in D1 (copied down) =SUMIF($B$1:$B$7,$B1,$C$1:$C$7)
Formula in E1 (copied down) =B1
Formula in F1 (copied to F2 and F3) =LARGE($D$1:$D$7,1)
Formula in G1 (copied to G2) =COUNTIF($D$1:$D$7,F1)
Formula in H1 (copied to H2 and H3) =VLOOKUP(F1,$D$1:$E$7,2,FALSE)
Formula in I1:I4 =F1



"Eli" wrote:

I would like a formula that returns the three highest categories within a
list. I think an example would be best:

A B
1 Animal Count
2 Dog 3
3 Cow 1
4 Dog 2
5 Cat 5
6 Sheep 2
7 Cat 2
8 Chicken 4

From this list I want to know the top 3 animals, thus the correct answer
would be:

A B
1 Animal Count
2 Cat 7
3 Dog 5
4 Chicken 4

Is there a nifty little (or big) forumla to give me the results in column A?
For what it is worth I am trying to avoid array formulas but if that is the
only way to do it I will live with it.

Thank you,
Eli

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
return next highest number in range Code Numpty Excel Worksheet Functions 6 April 21st 11 08:19 PM
Remove all duplicates and return highest value in new row Nikkynock Excel Discussion (Misc queries) 6 January 20th 09 09:31 PM
Return highest number or a blank if 0 Toney Excel Discussion (Misc queries) 6 October 8th 08 06:19 PM
Return Top Ranks For Certain Categories in Column SteveC Excel Discussion (Misc queries) 7 April 3rd 08 01:11 PM
Summing & return highest value PSU35 New Users to Excel 2 May 31st 06 07:39 PM


All times are GMT +1. The time now is 02:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"