Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Second most frequent number in a data set in Excel?

I am trying to find the second most frequently occuring value in a given data
set. I know MODE will give most frequent value but I need second, third,
fourth, and fifth most frequent values.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 299
Default Second most frequent number in a data set in Excel?

Here are some methods on how to get it

http://tinyurl.com/pa35w


--


Regards,

Peo Sjoblom

Excel 95 - Excel 2007
Northwest Excel Solutions
www.nwexcelsolutions.com
(Remove ^^ from email)



"Mr Grim" <Mr wrote in message
...
I am trying to find the second most frequently occuring value in a given
data
set. I know MODE will give most frequent value but I need second, third,
fourth, and fifth most frequent values.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default Second most frequent number in a data set in Excel?

Check out the link to this post:

http://tinyurl.com/n8vqj

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Mr Grim" <Mr wrote in message
...
I am trying to find the second most frequently occuring value in a given
data
set. I know MODE will give most frequent value but I need second, third,
fourth, and fifth most frequent values.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Second most frequent number in a data set in Excel?

i don't think excel's stock vba library provides such a function. you
can either buy a third party library or roll your own.

try the excel programming group for help.

here's an old post that will set you in the right direction:

http://www.exceljockeys.com/forums/f...ay-t12564.html

it's was written to count letter frequency in a string but is
conceptual the same, and easily adapted for, determine the frequency
of unique numbers in cells.

------------------------------------------------------------------------
ExcelJockey's profile: http://www.exceljockeys.com/forums/p...iewprofile&u=4
View this thread: http://www.exceljockeys.com/forums/v...c.php?t=304742

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,688
Default Second most frequent number in a data set in Excel?

Hmmm....

Is this the unsolvable problem?

Having tried the examples in the links, Bernie's doesn't handle duplicates,
Peo's will only work for the 2nd mode, RD's doesn't handle duplicates, Ron's
doesn't handle duplicates, my attempt also didn't handle duplicates.
Harlan's does handle the duplicates but it needs a trap, otherwise, after
the last unique value is returned the formula starts "randomly" repeating
until it's been copied to more rows than the indexed range. (at which point
it errors as it should)

Harlan's formula with a trap:

=IF(ROWS($1:1)<=SUMPRODUCT((rng<"")/COUNTIF(rng,rng&"")),INDEX(rng,MATCH(LARGE(FREQUEN CY(rng,rng)+(1-ROW(INDIRECT("1:"&(ROWS(rng)+1)))/(ROWS(rng)+1)),ROW(A1)),FREQUENCY(rng,rng)+(1-ROW(INDIRECT("1:"&(ROWS(rng)+1)))/(ROWS(rng)+1)),0)),"")

See the link regarding some strange behavior of
SUMPRODUCT((rng<"")/COUNTIF(rng,rng&"")):

http://tinyurl.com/jaen9

Biff

"Mr Grim" <Mr wrote in message
...
I am trying to find the second most frequently occuring value in a given
data
set. I know MODE will give most frequent value but I need second, third,
fourth, and fifth most frequent values.





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,688
Default Second most frequent number in a data set in Excel?

I found this in my stash!

A1:A20 = numbers (there is at least 1 mode)

Formula in B1:

=MODE(A1:A20)

Formula entered in B2 as an array using the key combination of
CTRL,SHIFT,ENTER (not just ENTER):

=MODE(IF(COUNTIF(B$1:B1,A$1:A$20)=0,A$1:A$20+{0,0} ))

Copy down until you get #N/A errors.

Biff

"Biff" wrote in message
...
Hmmm....

Is this the unsolvable problem?

Having tried the examples in the links, Bernie's doesn't handle
duplicates, Peo's will only work for the 2nd mode, RD's doesn't handle
duplicates, Ron's doesn't handle duplicates, my attempt also didn't handle
duplicates. Harlan's does handle the duplicates but it needs a trap,
otherwise, after the last unique value is returned the formula starts
"randomly" repeating until it's been copied to more rows than the indexed
range. (at which point it errors as it should)

Harlan's formula with a trap:

=IF(ROWS($1:1)<=SUMPRODUCT((rng<"")/COUNTIF(rng,rng&"")),INDEX(rng,MATCH(LARGE(FREQUEN CY(rng,rng)+(1-ROW(INDIRECT("1:"&(ROWS(rng)+1)))/(ROWS(rng)+1)),ROW(A1)),FREQUENCY(rng,rng)+(1-ROW(INDIRECT("1:"&(ROWS(rng)+1)))/(ROWS(rng)+1)),0)),"")

See the link regarding some strange behavior of
SUMPRODUCT((rng<"")/COUNTIF(rng,rng&"")):

http://tinyurl.com/jaen9

Biff

"Mr Grim" <Mr wrote in message
...
I am trying to find the second most frequently occuring value in a given
data
set. I know MODE will give most frequent value but I need second, third,
fourth, and fifth most frequent values.





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
Stop excel from dropping the 0 in the beginning of a number? Rosewood Setting up and Configuration of Excel 12 April 4th 23 02:12 PM
Vlookup to Return a Range of Data Rob Excel Discussion (Misc queries) 13 June 1st 06 04:02 AM
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
From several workbooks onto one excel worksheet steve Excel Discussion (Misc queries) 6 December 1st 05 08:03 AM
TRYING TO SET UP EXCEL SPREADSHEET ON MY COMPUTER MEGTOM New Users to Excel 5 October 27th 05 03:06 AM


All times are GMT +1. The time now is 11:44 PM.

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

About Us

"It's about Microsoft Excel"