ExcelKid_10
Board Regular
- Joined
- Mar 17, 2004
- Messages
- 87
Hello-
I am trying to create a frequency function that dynamically creates the bins and then counts the occurences for each....however, I am having some trouble getting what I have to work....
I know about the Partition function, however, my dataset will have negative values in it thus I need a custom function.
Function freq_bins(ret As Single, min As Single, max As Single, categories As Integer)
Dim Bins As Integer
Dim bin As Integer
Bins = (max - min) / categories
For i = 1 To 1
bin(i) = min
Next i
For i = 1 To categories
bin(i) = bin(1) + Bins
Next i
freq_bins = bin.Count
End Function
Any points in the right direction are greatly appreciated.
Thank you,
EK
I am trying to create a frequency function that dynamically creates the bins and then counts the occurences for each....however, I am having some trouble getting what I have to work....
I know about the Partition function, however, my dataset will have negative values in it thus I need a custom function.
Function freq_bins(ret As Single, min As Single, max As Single, categories As Integer)
Dim Bins As Integer
Dim bin As Integer
Bins = (max - min) / categories
For i = 1 To 1
bin(i) = min
Next i
For i = 1 To categories
bin(i) = bin(1) + Bins
Next i
freq_bins = bin.Count
End Function
Any points in the right direction are greatly appreciated.
Thank you,
EK