0

I would like to extract the 80th percentile from the second column in MyArray below. Is this possible in Excel VBA?

I have tried with Worksheetfunction.Index below although this gives error "Argument not optional".

Sub test()

    Dim MyArray(1 To 2, 1 To 100)

    For f = 1 To 100
    
        MyArray(1, f) = f
        MyArray(2, f) = f * 3

    Next f

    Debug.Print Application.WorksheetFunction.Percentile(Application.WorksheetFunction.Index(MyArray, 0.80))

End Sub

Thank you!

user2165379
  • 445
  • 4
  • 20

0 Answers0