Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default bimodal problem

Hi
I am trying to find the two modes in a bimodal list of numbers. The MODE
function in Excel only reports the lowest one it finds. After a reply
from Tom I tried to use the FREQUENCY function but couldn't get it to
work. I was trying to use it with an array Arr().
Does it only work with ranges ?
I have also noticed that that the CountIf function doesn't seem to work
with an array. Am I doing something wrong ?


If AA.Count(Arr()) 0 Then
Shd.Cells(416, i) = AA.Count(Arr())
Shd.Cells(417, i) = AA.Sum(Arr())
Shd.Cells(418, i) = AA.Average(Arr())
Shd.Cells(419, i) = AA.Median(Arr())
Shd.Cells(420, i) = AA.Mode(Arr())

The above statements all work. The statements below don't seem to work.


Shd.Cells(421, i) = AA.CountIf(Arr(), 1)

Shd.Cells(422, i) = AA.Frequency(Arr(), Shd.Range("E422:E429"))



End If

TIA

Andrew B
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default bimodal problem

Frequency returns an array:

Sub Mode()
Dim varr(1 To 100)
Dim varr1(1 To 5)
Dim v
For i = 1 To 100
varr(i) = Int(Rnd() * 5 + 1)
If i < 5 Then
varr1(i) = i
End If
Next
v = Application.Frequency(varr, varr1)
Debug.Print TypeName(v), LBound(v, 1), UBound(v, 1), LBound(v, 1), UBound(v,
2)
For i = LBound(v, 1) To UBound(v, 1)
Debug.Print i, v(i, 1)
Next
End Sub

--
Regards,
Tom Ogilvy

"Andrew B" wrote in message
...
Hi
I am trying to find the two modes in a bimodal list of numbers. The MODE
function in Excel only reports the lowest one it finds. After a reply
from Tom I tried to use the FREQUENCY function but couldn't get it to
work. I was trying to use it with an array Arr().
Does it only work with ranges ?
I have also noticed that that the CountIf function doesn't seem to work
with an array. Am I doing something wrong ?


If AA.Count(Arr()) 0 Then
Shd.Cells(416, i) = AA.Count(Arr())
Shd.Cells(417, i) = AA.Sum(Arr())
Shd.Cells(418, i) = AA.Average(Arr())
Shd.Cells(419, i) = AA.Median(Arr())
Shd.Cells(420, i) = AA.Mode(Arr())

The above statements all work. The statements below don't seem to work.


Shd.Cells(421, i) = AA.CountIf(Arr(), 1)

Shd.Cells(422, i) = AA.Frequency(Arr(), Shd.Range("E422:E429"))



End If

TIA

Andrew B



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default bimodal problem

Thanks for your help once again Tom.

Andrew Bourke


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
Colon at the end of excel file name(ex: problem.xls:1, problem.xls financeguy New Users to Excel 2 January 15th 10 01:15 AM
Bimodal histograms katrina Charts and Charting in Excel 1 November 21st 06 09:37 PM
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
Bimodal data Andrew B[_4_] Excel Programming 1 May 2nd 05 01:59 PM
Problem when multipple users access shared xl-file at the same time, macrocode for solve this problem? OCI Excel Programming 0 May 16th 04 10:40 PM


All times are GMT +1. The time now is 08:20 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"