Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default counting random occurrences

I have a spread sheet which has random but repeating occurrences of alpha
numerics or alpha alphas - say 5t or fe or d4 etc etc.
I want count the top 5 repeating a/n or a/a's without having to go to sort /
autosort clicking on each a/a or a/n to view the repeats.

is there a way of doing this please
Bill


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default counting random occurrences

The easiest way is to create a Pivot Table and then sort by the Count
descending. The following will get you results without sorting, but it needs
extra cells:

Lets say in column B we have
dog
horse
bird
angel
dog
horse
angel
cat
cat
horse
horse
horse
horse
cat
angel
horse
angel
angel
microbe
angel
angel
cat
fly
angel
cat
fly
cat
dog
fly
horse
angel
bird
angel
angel
cat
cat
dog
bird
angel
bird
angel
angel
dog
fle
horse
dog
fle
angel
angel
angel

In A1 enter:
=IF(COUNTIF($B$1:B1,B1)=1,COUNTIF($B$1:$B$50,B1)," ")
and then copy down thru A50. We will see:


6 dog
9 horse
4 bird
17 angel
dog
horse
angel
8 cat
cat
horse
horse
horse
horse
cat
angel
horse
angel
angel
1 microbe
angel
angel
cat
3 fly
angel
cat
fly
cat
dog
fly
horse
angel
bird
angel
angel
cat
cat
dog
bird
angel
bird
angel
angel
dog
2 fle
horse
dog
fle
angel
angel
angel
There is a once-only count associated with each repeating item.

Finally in C1 enter:
=LARGE($A$1:$A$50,ROW())
and copy down thru C5
In D1 enter:
=VLOOKUP(C1,A$1:B$50,2,0)
and copy down thru D5

In C1 thru D5 we will have:
17 angel
9 horse
8 cat
6 dog
4 bird

The five top repeats and how often they occurred.

If you get another response that simpler or find the Pivot Table acceptable,
ignore this post.
--
Gary''s Student - gsnu200720


"billy_bags" wrote:

I have a spread sheet which has random but repeating occurrences of alpha
numerics or alpha alphas - say 5t or fe or d4 etc etc.
I want count the top 5 repeating a/n or a/a's without having to go to sort /
autosort clicking on each a/a or a/n to view the repeats.

is there a way of doing this please
Bill


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
Counting occurrences on a particular date smore Excel Worksheet Functions 6 April 19th 07 11:22 PM
Counting occurrences over range of sheets DailyRich Excel Worksheet Functions 3 January 9th 06 10:49 PM
Counting number of occurrences LyleB_Austin Excel Worksheet Functions 1 September 15th 05 10:42 PM
counting occurrences in a range Judy Felfe Excel Discussion (Misc queries) 3 July 20th 05 07:25 PM
Counting occurrences of multiple conditions Jvanderv1 Excel Discussion (Misc queries) 2 April 6th 05 01:07 AM


All times are GMT +1. The time now is 07:18 PM.

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"