PC Review


Reply
Thread Tools Rate Thread

How to determine the top 5 occurrences from a list of numbers?

 
 
=?Utf-8?B?RXJpYw==?=
Guest
Posts: n/a
 
      25th Sep 2007
Does anyone have any suggestions on how to determine the top 3 occurrences
from a list of numbers? For example,

1,1,1,1,1,2,2,2,3,3,3,3,3,3,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,7 under column A
The occurrence of 1 is 5 times
The occurrence of 2 is 3 times
The occurrence of 3 is 6 times
The occurrence of 4 is 2 times
The occurrence of 5 is 5 times
The occurrence of 6 is 4 times
The occurrence of 7 is 5 times

It should return 3 in cell B1, 1 in cell B2, 5 in cell B3,
Since there are 3 numbers having 5 occurrences - 1,5,7, I only need to
select the rest of 2 numbers, then I prefer the smaller one 1, 5, and
ignoring 7.

Does anyone have any suggestions on how to do it in excel?
Thanks ver much in advance for any suggestions
Eric

 
Reply With Quote
 
 
 
 
=?Utf-8?B?ZXhjZWxlbnQ=?=
Guest
Posts: n/a
 
      25th Sep 2007
try FREQUENCY

=FREQUENCY(a1:a20;1) returns numbers of 1'ns


"Eric" skrev:

> Does anyone have any suggestions on how to determine the top 3 occurrences
> from a list of numbers? For example,
>
> 1,1,1,1,1,2,2,2,3,3,3,3,3,3,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,7 under column A
> The occurrence of 1 is 5 times
> The occurrence of 2 is 3 times
> The occurrence of 3 is 6 times
> The occurrence of 4 is 2 times
> The occurrence of 5 is 5 times
> The occurrence of 6 is 4 times
> The occurrence of 7 is 5 times
>
> It should return 3 in cell B1, 1 in cell B2, 5 in cell B3,
> Since there are 3 numbers having 5 occurrences - 1,5,7, I only need to
> select the rest of 2 numbers, then I prefer the smaller one 1, 5, and
> ignoring 7.
>
> Does anyone have any suggestions on how to do it in excel?
> Thanks ver much in advance for any suggestions
> Eric
>

 
Reply With Quote
 
=?Utf-8?B?ZXhjZWxlbnQ=?=
Guest
Posts: n/a
 
      25th Sep 2007
ups: use , not ;
=FREQUENCY(a1:a20,1)

"Eric" skrev:

> Does anyone have any suggestions on how to determine the top 3 occurrences
> from a list of numbers? For example,
>
> 1,1,1,1,1,2,2,2,3,3,3,3,3,3,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,7 under column A
> The occurrence of 1 is 5 times
> The occurrence of 2 is 3 times
> The occurrence of 3 is 6 times
> The occurrence of 4 is 2 times
> The occurrence of 5 is 5 times
> The occurrence of 6 is 4 times
> The occurrence of 7 is 5 times
>
> It should return 3 in cell B1, 1 in cell B2, 5 in cell B3,
> Since there are 3 numbers having 5 occurrences - 1,5,7, I only need to
> select the rest of 2 numbers, then I prefer the smaller one 1, 5, and
> ignoring 7.
>
> Does anyone have any suggestions on how to do it in excel?
> Thanks ver much in advance for any suggestions
> Eric
>

 
Reply With Quote
 
RichardSchollar
Guest
Posts: n/a
 
      25th Sep 2007
On 25 Sep, 05:52, Eric <E...@discussions.microsoft.com> wrote:
> Does anyone have any suggestions on how to determine the top 3 occurrences
> from a list of numbers? For example,
>
> 1,1,1,1,1,2,2,2,3,3,3,3,3,3,4,4,5,5,5,5,5,6,6,6,6,7,7,7,7,7 under column A
> The occurrence of 1 is 5 times
> The occurrence of 2 is 3 times
> The occurrence of 3 is 6 times
> The occurrence of 4 is 2 times
> The occurrence of 5 is 5 times
> The occurrence of 6 is 4 times
> The occurrence of 7 is 5 times
>
> It should return 3 in cell B1, 1 in cell B2, 5 in cell B3,
> Since there are 3 numbers having 5 occurrences - 1,5,7, I only need to
> select the rest of 2 numbers, then I prefer the smaller one 1, 5, and
> ignoring 7.
>
> Does anyone have any suggestions on how to do it in excel?
> Thanks ver much in advance for any suggestions
> Eric


Hi Eric

MODE will give you the most frequent occurrence ie so in B1:

=MODE(A1:A50)

(adjust range to suit).

So get the next most frequent eg in B2 downwards you could use:

=MODE(IF(ISNA(MATCH($A$1:$A$50,$B$1:$B1,0)),$A$1:$A$50))

confirmed with Ctrl+Shift+Enter and copied down as required.

Note that this is not a complete answer, as the order for ties (ie for
5 and 7) is determined by which appears first in the list.

Have you considered using a pivot table for this instead?

Richard

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine Index Numbers for Multiple Items Selected in List Gary S Microsoft Access VBA Modules 2 29th Jul 2009 05:51 PM
Extracting List of Occurrences Terry Bennett Microsoft Excel Worksheet Functions 7 15th Jan 2008 10:49 PM
How to determine the first 6 large numbers from a list? Eric Microsoft Excel Misc 4 11th Dec 2007 04:42 PM
How to determine the frequency of a list of numbers? =?Utf-8?B?RXJpYw==?= Microsoft Excel Misc 3 15th Jun 2007 08:58 AM
How do I determine which numbers in a list equal a given sum? =?Utf-8?B?aW5mcmF0ZXJyYQ==?= Microsoft Excel Misc 10 7th Oct 2005 11:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:47 AM.