+ Reply to Thread
Results 1 to 5 of 5

WorksheetFunction.Percentile - Array Formula

  1. #1
    Registered User
    Join Date
    03-17-2014
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    16

    WorksheetFunction.Percentile - Array Formula

    Hello there,

    I'm trying to get Percentile Formula within VBA in order to get a percentile by item and date. The excel Formula is the following:

    {=Percentile(IF(($A$2:$A$100=$D2)*($B:$B=E$1),$D:$D,""),0.9)}

    I've Tried the obvious with application.worksheetfunction.percentile but, obviously without sucess.

    Can you help in this one?

    Thanks in advance.

    Fernando Costa
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: WorksheetFunction.Percentile - Array Formula

    Hi Fjcosta,

    Try this code.
    Select your range E2:H4 and run the macro

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Registered User
    Join Date
    03-17-2014
    Location
    Lisbon, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    16

    Re: WorksheetFunction.Percentile - Array Formula

    Hello GC Excel,

    Thanks for the reply.

    I've already came up with the code up above, the thing is that it takes a huge amount of time since it is an array formula. I need to calculate about 100 percentil per day, and the average time, of one day report takes about 6minutes. In some days, i've have 10 report to calculate, and one hour is way more than i can spare with it. In the other hand, the file gets to heavy to work with array formulas, usually i add the code after the array formula in order to get free of those nasty calculations:

    Please Login or Register  to view this content.
    What i'm actually looking for is a way to calculate those results without a formula being inserted, which would take much less time.

    Best Regards,

    FJcosta

  4. #4
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,412

    Re: WorksheetFunction.Percentile - Array Formula

    How many rows with data do you have?
    The current formula calculates on the whole column (>1 000 000 rows). If you only have 10 000 rows, you could probably reduce the calculation time by 100... This would need a UDF probably.

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: WorksheetFunction.Percentile - Array Formula

    Something like:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Conditional array/percentile
    By fack7960 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-08-2014, 09:04 PM
  2. array calculation and percentile
    By ianbec in forum Excel General
    Replies: 2
    Last Post: 06-16-2011, 01:50 AM
  3. PERCENTILE Using Array Formula
    By Azad in forum Excel General
    Replies: 4
    Last Post: 05-04-2010, 03:48 AM
  4. Array Formula using Application.WorksheetFunction
    By Sonada in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2009, 06:47 PM
  5. Array Formula Using WorksheetFunction
    By xcelion in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-18-2005, 07:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1