+ Reply to Thread
Results 1 to 7 of 7

formula for choosing between Mode and Median

Hybrid View

  1. #1
    Registered User
    Join Date
    09-20-2016
    Location
    Ashland
    MS-Off Ver
    2013
    Posts
    3

    formula for choosing between Mode and Median

    I'm trying to use a data validation list as a way to allow the user to select between mode or median. I need a formula that would look at the value in the cell (Mode/Median) and return the correct product for a range of cells. I hope this makes sense. I can try to elaborate if necessary.

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: formula for choosing between Mode and Median

    Hello welcome to the forum.

    One option would be to use the CHOOSE function, for example:

    Formula: copy to clipboard
    =CHOOSE(MATCH(Validtion_Cell,{"MODE","MEDIAN"},0),MODE(Values),MEDIAN(Values))


    'Value' is the range of numbers, and 'Validation_Cell' the drop down selection. Here 'MODE' and 'MEDIAN' are hard coded (MATCH) but could be read from sheet cells along with the drop down list.

    Hope this helps.
    DBY

  3. #3
    Registered User
    Join Date
    09-20-2016
    Location
    Ashland
    MS-Off Ver
    2013
    Posts
    3

    Re: formula for choosing between Mode and Median

    Thank you so much for the quick response. That seems to work when the value in the validation cell is median, but when mean is chosen it returns #N/A. here is the formula I used based on your advice.
    Formula: copy to clipboard
    =CHOOSE(MATCH(A11,{"MODE","MEDIAN"},0),MODE(B7:B10),MEDIAN(B7:B10))


    Did I do something wrong?

  4. #4
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: formula for choosing between Mode and Median

    Hi

    I need a formula that would look at the value in the cell (Mode/Median)
    You did say MODE/MEDIAN not Mean. There's no MEAN function in Excel as it's interpreted as AVERAGE, of which there are a few variations. For each drop down item you have to add the relevant function to the choices.

  5. #5
    Registered User
    Join Date
    09-20-2016
    Location
    Ashland
    MS-Off Ver
    2013
    Posts
    3

    Re: formula for choosing between Mode and Median

    Thank You, I'm an idiot!

  6. #6
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Re: formula for choosing between Mode and Median

    working on my PC
    Mode is the number that is mostly repeated in a range, if there is no repetition of any number you will get #NA

    wrap with iferror to show any error message.

    iferror(your formula,value if error)

    Thanks
    Mark the thread as solved if you are satisfied with the answer.


    In your first post under the thread tools.

    Mahju

  7. #7
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: formula for choosing between Mode and Median

    Glad to have helped. Mahju is correct, MODE will return an error in those circumstances.

+ 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. [SOLVED] Compute Mean, Median & Mode of 1D Array
    By jewelsharma in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2016, 04:09 AM
  2. Replies: 4
    Last Post: 12-04-2014, 05:55 PM
  3. [SOLVED] Mode If and Median If help
    By bobthebofifn in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-19-2014, 01:44 PM
  4. [SOLVED] Calculate Mode, Median and Average based on data in 3 columns
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2014, 05:56 PM
  5. Median and mode
    By maestrodos in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-01-2012, 10:40 PM
  6. Mean, median and mode
    By brandon in forum Excel General
    Replies: 6
    Last Post: 05-06-2008, 12:39 PM
  7. Replies: 2
    Last Post: 08-23-2007, 03:07 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