[mso] Re: Excel MODE Function- Ties?
- From: "Ray Blake" <ray@xxxxxxxxx>
- To: <mso@xxxxxxxxxxxxx>
- Date: Fri, 22 Apr 2005 18:27:53 +0100
Here's an approach you might use. I start with this data:
A B C D
1 1
2 2
3 3
4 2
5 2
6 4
7 1
8 1
In B1 I enter this formula:
=COUNTIF($A$1:$A$8,A1)
Dragging this down as far as B8, I get this:
A B C D
1 1 3
2 2 3
3 3 1
4 2 3
5 2 3
6 4 1
7 1 3
8 1 3
Clearly, I have a tied mode; both 1 and 2 appear 3 times each.
In C1 I type:
=MAX(B1:B8)
In D1 I type:
=COUNTIF(B1:B8,C1)
This results:
A B C D
1 1 3 3 6
2 2 3
3 3 1
4 2 3
5 2 3
6 4 1
7 1 3
8 1 3
The value in C1 is the maximum frequency of any number in the range
A1:A8. Because both 1 and 2 appear 3 times each, the result is 3.
The value in D1 shows how many entries in A1:A8 appear that many times.
Here the result is 6 because it counts all the 1a and the 2s. If I
change the data slightly so there is a single mode, see what happens:
A B C D
1 1 2 3 3
2 2 3
3 3 1
4 2 3
5 2 3
6 4 2
7 1 2
8 4 2
Clearly, if C1=D1 there is a simgle mode. Otherwise, there is more than
one.
Ray
------------------------------------
GR Business Process Solutions
Ray Blake
Head of Software Design
ray@xxxxxxxxx
Braedon
Newell Road
Hemel Hempstead
Herts HP3 9PD
tel: 01442 396518
fax: 01442 389353
mobile: 07834 226601
www.grbps.com
------------------------------------
-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On
Behalf Of Anthony A. Luscre
Sent: 22 April 2005 17:41
To: mso@xxxxxxxxxxxxx
Subject: [mso] Excel MODE Function- Ties?
I am using the mode function to find the most popular item from a group
of choices.
The category is listed in column A1:A:30, in column B I have the MODE
function with range of C1:AK1.
I columns C through AK are the code number for each person's favorite
item (their vote).
The mode function tells me which code number occurs most frequently (the
winner).
The problem is if there is a tie the MODE function returns the lowest
number only.
What I need is, at minimum, is a way to tell if there has been a tie or
ideally not only that there has been a tie but which code numbers were
tied.
Any ideas?
Thanks
Anthony
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, send an email to
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in
the subject line.
Or, visit the group's homepage and use the dropdown menu. This will also allow
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to use the files section for sharing files with the group, send a
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with
instructions. Once you are a member of the files group, you can go here to
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************
- Follow-Ups:
- [mso] Re: Excel MODE Function- Ties?
- From: Anthony A. Luscre
- References:
- [mso] Excel MODE Function- Ties?
- From: Anthony A. Luscre
Other related posts:
- » [mso] Excel MODE Function- Ties?
- » [mso] Excel MODE Function- Ties?
- » [mso] Re: Excel MODE Function- Ties?
- » [mso] Re: Excel MODE Function- Ties?
- [mso] Re: Excel MODE Function- Ties?
- From: Anthony A. Luscre
- [mso] Excel MODE Function- Ties?
- From: Anthony A. Luscre