Announcement

Collapse
No announcement yet.

Unconfigured Ad Widget

Collapse

Quartile Function In VBA

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Quartile Function In VBA

    Hi All,

    Im looking to use vba to determin upper and lower quartiles, i know how to do this through excel "QUARTILE(B9:B59990,1)", but was wondering if anyone would of any code to do this in visual basic?

    Any advice welcome

    Thanks

    VBA_Worker2

  • #2
    Re: Quartile Function In Visual Basic (vb)

    Hi VBA_Worker2,

    Welcome to board!

    This works for me

    Dim Ary, wf As WorksheetFunction
    Ary = Array(5, 4, 9, 1, 6)

    Set wf = Application.WorksheetFunction
    MsgBox wf.Quartile(Ary, 1)


    HTH
    Kris

    ExcelFox

    Comment


    • #3
      Re: Quartile Function In VBA

      Thanks Krishnakumar

      this is brilliant.
      Last edited by Dave Hawley; August 2nd, 2008, 10:14.

      Comment


      • #4
        Re: Quartile Function In Visual Basic (vb)

        Originally posted by Krishnakumar View Post
        Hi VBA_Worker2,

        Welcome to board!

        This works for me

        Dim Ary, wf As WorksheetFunction
        Ary = Array(5, 4, 9, 1, 6)

        Set wf = Application.WorksheetFunction
        MsgBox wf.Quartile(Ary, 1)


        HTH

        I found that "Evaluate(Application.WorksheetFunction.Quartile(oRngTemp, 4)" fails when the range' local address "oRngTemp.AddressLocal" has $ in the address, i.e $BC$13:$BC$17. Not all cells are evaluated to find desired statistic.

        Comment

        Trending

        Collapse

        There are no results that meet this criteria.

        Working...
        X