#### How do I get the 2nd Mode in a range of cells

```I want to attain the 2nd, 3rd, 4th, etc. most frequent
number in a range of cells.  Using the Mode function I can
receive the most frequent but how do I get the 2nd, 3rd,
4th,etc. from the same range.
Thanks.
```
 0
anonymous (74723)
10/2/2004 5:26:35 PM
excel.misc 78881 articles. 5 followers.

9 Replies
662 Views

Similar Articles

[PageSpeed] 6

```Hi
assuming your list of numbers is in A1:A10 try the following formulas:
B1:  =     MODE(\$A\$1:\$A\$10)
B2: (array entered with CTRL+SHIFT+ENTER)         =
MODE(IF(COUNTIF(\$B\$1:B1,\$A\$1:\$A\$10)=0,\$A\$1:\$A\$10+{0,0}))

--
Regards
Frank Kabel
Frankfurt, Germany

anonymous@discussions.microsoft.com wrote:
> I want to attain the 2nd, 3rd, 4th, etc. most frequent
> number in a range of cells.  Using the Mode function I can
> receive the most frequent but how do I get the 2nd, 3rd,
> 4th,etc. from the same range.
> Thanks.

```
 0
frank.kabel (11126)
10/3/2004 1:29:42 AM
```On Sun, 3 Oct 2004 03:29:42 +0200, "Frank Kabel" <frank.kabel@freenet.de>
wrote:

>Hi
>assuming your list of numbers is in A1:A10 try the following formulas:
>B1:  =     MODE(\$A\$1:\$A\$10)
>B2: (array entered with CTRL+SHIFT+ENTER)         =
>MODE(IF(COUNTIF(\$B\$1:B1,\$A\$1:\$A\$10)=0,\$A\$1:\$A\$10+{0,0}))

Frank,

I have not figured out a formulaic way of doing this, but I tried your method
on a random list of 150 numbers, and it misses quite a few when multiple
numbers have the same frequency.

Perhaps I am doing something wrong?

--ron
--ron
```
 0
ronrosenfeld (3122)
10/3/2004 2:30:16 AM
```On Sat, 2 Oct 2004 10:26:35 -0700, <anonymous@discussions.microsoft.com> wrote:

>I want to attain the 2nd, 3rd, 4th, etc. most frequent
>number in a range of cells.  Using the Mode function I can
>receive the most frequent but how do I get the 2nd, 3rd,
>4th,etc. from the same range.
>Thanks.

One method to do this:

1.  Sort the range descending.
2.  Data/Subtotals Use Function: Count
3.  Click on the (2) button to collapse seeing only the Counts.
4.  Sort the visible column again, descending.

Another method would be to use a Pivot Table.

Drag the Data to the Rows and Data field.  Right Click the data field to select
Count as the function to use; then sort descending in the Total Column

--ron
```
 0
ronrosenfeld (3122)
10/3/2004 2:30:36 AM
```Hi Ron
formulas work for me (also with numbers which have the same frequency).
If you like send me your file and I'll just check this (now getting
curious of course).

email: Frank[dot]kabel[at]freenet[dot]de

--
Regards
Frank Kabel
Frankfurt, Germany

Ron Rosenfeld wrote:
> On Sun, 3 Oct 2004 03:29:42 +0200, "Frank Kabel"
> <frank.kabel@freenet.de> wrote:
>
>> Hi
>> assuming your list of numbers is in A1:A10 try the following
>> formulas: B1:  =     MODE(\$A\$1:\$A\$10)
>> B2: (array entered with CTRL+SHIFT+ENTER)         =
>> MODE(IF(COUNTIF(\$B\$1:B1,\$A\$1:\$A\$10)=0,\$A\$1:\$A\$10+{0,0}))
>
> Frank,
>
> I have not figured out a formulaic way of doing this, but I tried
> your method on a random list of 150 numbers, and it misses quite a
> few when multiple numbers have the same frequency.
>
> Perhaps I am doing something wrong?
>
> --ron
> --ron

```
 0
frank.kabel (11126)
10/3/2004 9:08:58 AM
```On Sun, 3 Oct 2004 11:08:58 +0200, "Frank Kabel" <frank.kabel@freenet.de>
wrote:

>Hi Ron
>formulas work for me (also with numbers which have the same frequency).
>If you like send me your file and I'll just check this (now getting
>curious of course).

Well, I guess I was doing something wrong last night, as today I cannot
reproduce the error.

But it seems to work fine now.  I must have been tired, last night, or
something.  Sorry.

--ron
```
 0
ronrosenfeld (3122)
10/3/2004 12:21:39 PM
```Let A3:A19 house:

{"Num";1;2;4;4;4;3;6;6;6;5;7;7;8;8;1;7}

where Num is just a label in A3.

In B3 enter: Count [ which is just a label ]

In B4 enter & copy down:

=IF(ISNUMBER(A4)*ISNA(MATCH(A4,\$A\$3:A3,0)),COUNTIF(\$A\$4:\$A\$19,A4),"")

In C3 enter: Rank [ which is just a label ]

In C4 enter & copy down:

=IF(N(B4),RANK(B4,\$B\$4:\$B\$19)+COUNTIF(\$B\$4:B4,B4)-1,"")

In D1 enter, for example: 4 [ which means 4 most frequent numbers ]

In D2 enter:

=MAX(IF(INDEX(B4:B19,MATCH(D1,C4:C19,0))=B4:B19,C4:C19))-D1

which you need to confirm with control+shift+enter instead of just with
enter.

In D3 enter: Mode [ which is just a label ]

In E3 enter: Freq  [ which is just a label ]

In D4 enter and copy across to E4 then down:

=IF(ROW()-ROW(D\$4)+1<=\$D\$1+\$D\$2,INDEX(A\$4:A\$19,MATCH(ROW()-ROW(D\$4)+1,\$C\$4:\$C\$19,0)),"")

<anonymous@discussions.microsoft.com> wrote in message
news:2a9201c4a8a4\$f7d32790\$a401280a@phx.gbl...
>I want to attain the 2nd, 3rd, 4th, etc. most frequent
> number in a range of cells.  Using the Mode function I can
> receive the most frequent but how do I get the 2nd, 3rd,
> 4th,etc. from the same range.
> Thanks.

```
 0
akyurek (248)
10/3/2004 1:14:17 PM
```Hi Ron and Frank!

How strange is this:

I also was getting incorrect results last night when I
tried Frank's formula. But now, it's working just fine!

Good one Frank.

Biff

>-----Original Message-----
>On Sun, 3 Oct 2004 11:08:58 +0200, "Frank Kabel"
<frank.kabel@freenet.de>
>wrote:
>
>>Hi Ron
>>formulas work for me (also with numbers which have the
same frequency).
>>If you like send me your file and I'll just check this
(now getting
>>curious of course).
>
>Well, I guess I was doing something wrong last night, as
today I cannot
>reproduce the error.
>
larger range.
>
>But it seems to work fine now.  I must have been tired,
last night, or
>something.  Sorry.
>
>
>--ron
>.
>
```
 0
biffinpitt (3172)
10/4/2004 12:27:25 AM
```On Sun, 3 Oct 2004 17:27:25 -0700, "Biff" <biffinpitt@comcast.net> wrote:

>Hi Ron and Frank!
>
>How strange is this:
>
>I also was getting incorrect results last night when I
>tried Frank's formula. But now, it's working just fine!
>
>Good one Frank.
>
>Biff

That is very strange.  Must have been the phase of the moon, or something.  :~)

--ron
```
 0
ronrosenfeld (3122)
10/4/2004 1:48:52 AM
```For another approach, using MODE() and MATCH(), see my contrib in:

http://www.mrexcel.com/board2/viewtopic.php?t=48379&highlight=

<anonymous@discussions.microsoft.com> wrote in message
news:2a9201c4a8a4\$f7d32790\$a401280a@phx.gbl...
>I want to attain the 2nd, 3rd, 4th, etc. most frequent
> number in a range of cells.  Using the Mode function I can
> receive the most frequent but how do I get the 2nd, 3rd,
> 4th,etc. from the same range.
> Thanks.

```
 0
akyurek (248)
10/4/2004 5:46:48 AM

Similar Artilces:

Combining cells
Using Excel 2002: I will open a text file into excel. This file has no formatting, but the end result would be using two columns. The text file for example has: Music1 from site1 and site2 special 90876 Music100 extra from site1 87654 Music02 misc sites 10020 I want to put the numbers, 90876, 87654, 65409 in the same column "B" and have the other text combined into one column "A". When I use space delimited I can move the numbers in the same column. How do I combine the rest of the text which are word for word in columns A,B,C,D etc into one column "A"? End...

How to get Calendar to send me reminders
I have changed my e-mail address but for some reason I cannot get Calendar to send reminders to my new address - I think I have carried out all that is necessary to effect the changover but I am not getting reminders sent. Can anyone help please? Is the Calendar Live ID based and accessible at Calendar.live.com ? -- ....winston ms-mvp mail "Dabardevon" wrote in message = news:FDC2B3B2-EDE4-41B1-BFC4-C0F9ED59CFB9@microsoft.com... I have changed my e-mail address but for some reason I cannot get = Calendar to send reminders to my new address - I think I have...

How to return a range of values in a drop-down.
Is there a way to have Excel return a range of values in a drop down in one cell based on input from another cell. As an example: Cell A1 has the text "PVC Pipe" I want cell A2 to get input from A1, read through a table, and return the corresponding values (sizes) of PVC pipe. The results in A2 would be the following in a drop down: 4" 6" 8" If cell A1 contained the text "Metal Pipe" it would return values (sizes) of metal pipe from a table and not display the sizes of PVC pipe. 10" 12" 15" The bottom line and...

Some recipients get the attachment, some get winmail.dat
This one has me baffled. We are using Exchange 2000 and Outlook 2000 and have been for 8 months. No previous problems with attachments (.doc, .xls, .jpg). About 2 weeks ago, we started hearing from certain recipients that the attachment wasn't arriving; instead they were getting an unreadable file called winmail.dat. MS says that this is because the sender is using Rich Text to format the email. We have changed the senders to use Plain Text and still have the same problem. If the email is sent to several recipients, some will get the attachment fine, some will not. This didn'...

How to get the CScrollBar's Handle in CTreeCtrl?
Hey,All: I thought I have a problem when I trid to get the CScrollBar's handle from my CTreeCtrl extended handle. Can anybody tell me whether I can get the handle of the CScrollBar from the CTreeCtrl? Thanks in advance! Carl :-| Carl wrote: > Hey,All: > > I thought I have a problem when I trid to get the CScrollBar's handle from > my CTreeCtrl extended handle. > Can anybody tell me whether I can get the handle of the CScrollBar from the > CTreeCtrl? > > Thanks in advance! > Carl > :-| > > Sorry, it is not that simple. The scroll bars that...

Dexterity
When clicking on a lookup icon under debug mode, I receive the following message: "Cannot access this form because the dictionary containing it is not loaded." If anyone knows how to fix this issue, please let me know. Thanks, Pat When use lookup buttons in GPlains, GPlain open smart list window. in test mode you wouldn't have access to smart list. in Great Plains, take off those alternative windows under security, depends on which module you are working on, only take off smart list alternative window on that module will be ok. hlv is correct. The Lookups you see whe...

Copy row2 cells down to last cell where the whole row isn't all blank
Hi Colo, I tried to run your code to copy formula in cell K2 (I place the cursor on cell K2) down to last cell in column K, it doesn't copy down the formula. Is there anything missing from the code ? Please help and thanks very much! Sub Cell2CopyToEnd() Dim col As Long col = ActiveCell.column Range(Cells(2, col), Cells(Rows.Count, col).End(xlUp)).Formula = _ Cells(2, col).Formula End Sub --- Message posted from http://www.ExcelForum.com/ I put a value in K99 (so the macro knew when to quit) and I put a formula in K2. With K2 selected, I ran the code and it worked fine. The co...

wrong number in cell
In XP PRO & Excel 2002 I have a cell formated as General and unlocked. I try to enter a number { 08607100 } I hit enter and it changes to { 8607100 } no matter what I try it. This is another example of a problem in a cell I enter { 03E2 } hit enter and it changes to { 3.00E+02 }. Is there some bug in certain cells or with excel 2002 or is there some setting I am missing? Help -- Thanks MK pipco wrote: > In XP PRO & Excel 2002 I have a cell formated as General and unlocked. I > try to enter a number { 08607100 } I hit enter and it changes to { 8607100 &g...

A Crystal Beginner
I am using Crystal 9.2.4.77 and have loaded the Crystal enhancements. Now I want to do against the CRM database. What do I do? I thought I would create a data source to the CRM SQLserver, which I did, then connect to it through Crystal Reports. That works, but when I drill down on the AAA_MSCRM database to choose my tables, it shows me dbo as the only option (where did this come from??) and under that are just a few generic tables. No CRM tables. Something's not quite right. What am I missing? file - log on to aps server "KBLawson" <klawson@aetinc.com> wrote in ...

Static Range, Dynamic Chart Data
I have read some great tips on making my chart dynamic that involv changing the range. The chart I would like to create is a 12 month lin chart. I want the chart to always be 12 months in length, but the poin to simply not be plotted if the value of the cell "blank". In othe words, stop the line short of the end of the plot area. The 12 months of charted cells have a formula lik =IF(A1=0,"",SUM(A1:A6)). So you see a blank cell if A1 is 0. But th chart shows this as a zero value. If I delete the contents the char does what I would like. Is there a way to simply change the ...

Can't display CListView in Report mode
I have a View derived from CListView. In it's OnInitialUpdate method, I do 4 InsertColumns that seem to work - when I trace thru them, each call returns the number of the column I indicated. In another method, I fill in the rows of the listview with calls to InsertItem followed by calls to SetItem. Again, tracing indicates these all succeed. But when the view displays, it looks like the text for each item is squeezed into a cell along the top of the view: AB.. AC.. AD.. BG.. HG.. PO.. and if I click on one of these, I get a thin vertical "cell" with all the text in i...

Duplicate cells #4
I have an excel spreadsheet of approximately 1500 Names,addressses etc. there are many duplicate cells of which I want to delete the duplicates and I am looking for the best way to accomplish this. I am new to excel and using formulas but if there is a way to use color to point out the duplicates, that would be very helpfull, thanks You could try to use Advanced Filter to get rid of the duplicates. Ensure that you have headers in row 1 (Name, Address_1, Address_2 etc) and highlight all the data including the headers. Then click Data | Filter | Advanced Filter and in the pop up click Un...

Cannot get fast forward or fast reverse to work with WMP 11
I am running Vista Home Premium on a HP G 217-EM Notebook which comes pre-installed with Windows Media Player 11. When I play cds and try to fast forward or fast reverse by keeping the fast forward or fast reverse buttons constantly depressed nothing happens. Why is this, and can anyone come up with a solution? Many thanks This doesn't work on my system either, so it's probably just a limitation of WMP. Fast forward and fast reverse should work fine when you rip the CD's to MP3 or WMA files, and play these files instead. Regards -- Tim De Baets http://www....

Autorecover in Compatibility Mode is a Disaster
There are recurring reports/posts of problems with the new Excel 2007 autorecovery process when it gets applied to "compatibility mode" (e.g., Excel 2003) models. Excel 2007 is effectively unusable when autorecover is turned on (the default). I'd like to know when Microsoft plans on fixing this problem, and what workarounds exist for it in the meantime. - Mark ...

Get paid while you get online!!
I found a great Internet company - Cashfiesta.com - that has created a product everyone can benefit from. They pay you while you work or play on your computer. All you need to do is keep their software - the FiestaBar=99 - active while you are online. They even pay you when your friends are using their computers. Unlike other companies, Cashfiesta gives you control over how much money you earn. They have an individual payrate based on the number of Special Offers you sign up for. As some of these offers are free, you can increase your payrate up to 33 times without spending a penny. It's...

Can't get auto-update (update) to install
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC I've been trying to manually check for updates to Word 2008, and I get a &quot;critical update&quot; notice, asking me to install auto-update. When I try to install it, I cannot. It just keeps repeating the attempt, in an &quot;endless loop.&quot; What to do? <br> Thank you. ...

Hello All: I have a relatively large spreadsheet. I am getting errors (see after my signature line). What could be causing these errors? Is it that the spreadsheet is too large? Thanks Deguza -------------------------------------------------------- Microsoft Office Excel File Repair Log Errors were detected in file 'C:\Documents and Settings\deguza\My Documents\sales\Sales_2006_2007.xls' The following is a list of repairs: Global PivotTable report information was repaired due to integrity problems. Global PivotTable report information was repaired due to integrity problems. Glo...

Reg getting the next IV Document Number field !
Hi, I am creating a window in dexterity similar to the item transaction entry window (Transactions>Inventory> Transaction Entry). In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field. I wanted to know if there is any function , or table that i can access to get the next document number in the new window that i am creating. Thanks, swetha -- swetha >In the Item transaction Entry window, the Document number field defaults to the next document number when we move the focus to that field.< T...

2nd Attempt
I have recently been having difficulties with sending emails. When I make a reply and hit send the email saves to the outbox but does so in bold normal type and refuses to send. Sometimes if I make a new msg, copy by pasting everything and then save, the email saves to outbox in italics. This is "normal" I believe. The email goes out OK then. This seems to have started spontaneously. Anyone know what is happening and why. Perhaps more importantly how do I fix it? -- Jerry ...

referencing a cell determined by name in another cell
How do I reference a cell within a formula based on the contents of another cell? For example if one cell contained a reference/address for a column array, how could I refer to this cell (and hence the column array) within the vlookup function instead of having to put in the actual table array. In other words an external way of changing the table array rather than going into the formula. VLOOKUP(lookup_value,table_array,col_index_num,range_lookup) Hi use INDIRECT for this -- Regards Frank Kabel Frankfurt, Germany "ricardo wants answers" <ricardo wants answers@discussion...

How do I get??
Sorry if this seems a fairly easy question to you guys. I have a spreadsheet and I need to get the current system time into a cell. The format of the time is hh:mm am/pm. Any assistance would be most helpful. Hi try =INT(NOW()) in this cell and format is to your needs -- Regards Frank Kabel Frankfurt, Germany PM wrote: > Sorry if this seems a fairly easy question to you guys. > > I have a spreadsheet and I need to get the current system time into a > cell. The format of the time is hh:mm am/pm. > > Any assistance would be most helpful. PM, in the cell you want pu...

Need to change data entered into cell. HELP ASAP!!
I have a list of over 7000 unique numbers (i.e. 123 or 77- 123). I need to add the letters "MH" in front of each number. Is there an easier way to do this than to click and edit each individual cell manually? Please help, anyone have any suggestions? Lots of thanks in advance. Hi one way (if you only have numbers): use acustom format : "MH"0 another way: in the adjacent column in row one (lets say in B1) enter the formula ="MH" & A1 copy this formula down After this select column B and copy the contents (CTRL+C). goto 'Edit - Paste Special' a...

Get notified when Out of Office is on
I am using Outlook 2007. With 2003, when returning from leave, I used to get a notification that the Outlook out of office was still on and asking me if I wanted to switch it off. This reminder no longer appears with 2007. How can I switch this setting on so that I get the notification? "Mary Ann" <MaryAnn@discussions.microsoft.com> wrote in message news:ED5533A7-D0EA-41B8-B1A0-A9D15FB6FD98@microsoft.com... >I am using Outlook 2007. With 2003, when returning from leave, I used to get > a notification that the Outlook out of office was still on and asking me ...

Getting Control ID in Active X control
GetWindowLong return 0. You need to call GetDlgCtrlID from outside the activex control as the function available within the control returns an arbitrary value of zero. Take a look at this article http://xendra.ens.uabc.mx/~sinfante/loo/libro/ch17_4.htm particularly the paragraph preceeding the title "MFC and Ambient Properties". This really begs the question why you want the ID in the first place as activex controls have to be fully self containing to operate - with a few exceptions where sibling controls need to be able to locate each other. - Tim "ytv" <...