+ Reply to Thread
Results 1 to 2 of 2

Compute Mean, Median & Mode of 1D Array

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Compute Mean, Median & Mode of 1D Array

    In VBA:
    - Are there any in-built array functions to compute Median, Mode and Mean values of one-dimensional integer arrays?
    - If not, is there a simple way of computing these, without copying values to the worksheet cells?
    - Also, is there a simple way to sort Array elements in ascending or descending order? i.e. return a sorted array.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Compute Mean, Median & Mode of 1D Array

    Hi,

    You can provide an array as the argument to Application.WorksheetFunction.Median, Application.WorksheetFunction.Average and Application.WorksheetFunction.Mode

    There are many different sorting algorithms, such as QuickSort or BubbleSort. You can also use the ArrayList object from the .Net runtime.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

+ 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. Replies: 4
    Last Post: 12-04-2014, 05:55 PM
  2. [SOLVED] Mode If and Median If help
    By bobthebofifn in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-19-2014, 01:44 PM
  3. Median and mode
    By maestrodos in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-01-2012, 10:40 PM
  4. Compute median of indexed array
    By agraefe78 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-26-2008, 01:53 PM
  5. Mean, median and mode
    By brandon in forum Excel General
    Replies: 6
    Last Post: 05-06-2008, 12:39 PM
  6. Replies: 2
    Last Post: 08-23-2007, 03:07 AM

Tags for this Thread

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