tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,926
- Office Version
- 365
- 2019
- Platform
- Windows
I have 10 rows of data in column A.
I can calculate the upper quartile as follows:
If instead of using an array, I choose to use a collection, like this:
it does not work and fails on this line:
</strike>
I assume the reason is the first argument of Quartile_Exc expects an array? So does that defeat the object of using a collection instead of an array?
Thanks
I can calculate the upper quartile as follows:
Rich (BB code):
Dim MyArray() As Variant
MyArray() = Cells(1, 1).CurrentRegion.Value
Dim UQ As Double
UQ = Application.WorksheetFunction.Quartile_Exc(MyArray(), 3)
If instead of using an array, I choose to use a collection, like this:
Rich (BB code):
Dim MyColl As Collection
Set MyColl = New Collection
Dim Counter As Integer
For Counter = 1 to 10
MyColl.Add Cells (Counter, 1).Value
Next Counter
Dim UQ As Double
UQ = Application.WorksheetFunction.Quartile_Exc(MyColl, 3)
it does not work and fails on this line:
Rich (BB code):
UQ = Application.WorksheetFunction.Quartile_Exc(MyColl, 3)<strike>
</strike><strike>
</strike>
Thanks
Last edited: