calling Excel function Median and Quartile

P

Peter Hafner

Hi there,

I want to call the excel function median and quartile from within a
query. I tried following VBA code:

Function med(ByVal FirstArg As Double, ParamArray OtherArgs()) As Double
excel.WorksheetFunction.Median (FirstArg)
End Function

Sub test()
MsgBox (med(12, 1, 88, 12))
End Sub

This gives me always a 0 as result. What is wrong?

Thanks,
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top