+ Reply to Thread
Results 1 to 4 of 4

Finding formula per specific category - mean, median, and mode. Bonus - Histogram

  1. #1
    Registered User
    Join Date
    08-18-2017
    Location
    Charlotte, NC, USA
    MS-Off Ver
    Microsoft 2016
    Posts
    74

    Finding formula per specific category - mean, median, and mode. Bonus - Histogram

    Hey all,

    In the attached spreadsheet, you will find the duration for that specific tenant, in that specific site, and when I group the sites using a pivot table, I can get to the Site's average duration, but I feel that it is only part of the information. I believe looking at the mode for example, would show the number of tenants that have stayed less than X days.

    So, is there a formula that would calculate the mean, median, and mode per specific Site? It can be on a new worksheet if that makes it easier (thousands of rows in original file). For a bonus, is there a way to quickly show a histogram for each particular site (again, separate worksheet is fine)?
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Finding formula per specific category - mean, median, and mode. Bonus - Histogram

    So, is there a formula that would calculate the mean, median, and mode per specific Site?
    Not that I am aware of. It would take 3 separate formulas.

    (thousands of rows in original file)
    How many thousands? 2K, 10K ... 100K? It can make a difference.

    In the meantime here is my first "run". With the understanding that thousands is 2-3 K
    1. Copy / paste the Sites in column R
    2. Remove duplicates
    3. For the mean this formula in S2 and filled down.
      Formula: copy to clipboard
      Please Login or Register  to view this content.
    4. For median (and this is where the volume of data can become an issue). This is an array formula. They are resource hungry and can slow your workbook down. In T2 and filled down.
      Formula: copy to clipboard
      Please Login or Register  to view this content.
    5. Array formula issues hold true for mode as well. Additionally some of the data is multi-modal. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter. In U2 filled down and across until you get blanks.
      Formula: copy to clipboard
      Please Login or Register  to view this content.

    If the array formulas are too much load for the data you have let me know. There may be a work around. It would likely require some helper columns.

    Also I am not clear on what you want as a histogram. Please upload with a hand typed (a few examples) of the layout/returns envisioned.
    Dave

  3. #3
    Registered User
    Join Date
    08-18-2017
    Location
    Charlotte, NC, USA
    MS-Off Ver
    Microsoft 2016
    Posts
    74

    Re: Finding formula per specific category - mean, median, and mode. Bonus - Histogram

    Thanks Dave - this is a great start. I'm assuming the other columns for mode are the tiers (the next mode)? I will work on getting you histograms.

    Edit: about 55k rows

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Finding formula per specific category - mean, median, and mode. Bonus - Histogram

    No. Those are not tiered. They are all equally modal. (actually none of the values are strictly speaking modal)

    I am not sure how to explain this well.

    A value qualifies as modal only if there are two or more instances of the value. Which ever value occurs the most times is the mode. In the examples there are multiple duration values for the same site. Also in the example(s) there are only single instances of those values. That is among the reasons why there is a +{0,0} introduced in the formula. It forces all values to repeat at least once. In your sample cases there are never more than two repeating values after adding {0,0}. So they all qualify. MODE.MULT returns all of them in an array. If you select just the MODE.MULT(IF($R2=$A$2:$A$26,$O$2:$O$26+{0,0})) part in the formula bar and hit the F9 function key ... in cell U2 ... you will see an array {1626;1619}. ie. there are multiple modes.

    The sense of this might be more apparent with any given site having more than one instance of a given duration value.

    If you want tiered returns that is a different issue. It begs for additional details (how would you want relative tiers indicated/displayed). It would also require MODE or MODE.MULT nested within other functions. It also exacerbates the array formula load.
    Last edited by FlameRetired; 11-20-2018 at 06:28 PM.

+ 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] formula for choosing between Mode and Median
    By orijonl in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-20-2016, 11:39 AM
  2. Replies: 4
    Last Post: 07-31-2015, 12:54 AM
  3. Finding the median in specific cells of one column
    By KaiserD2 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-20-2014, 12:45 PM
  4. [SOLVED] Formula help - finding 1/4 sales amount and then the appropriate bonus
    By invgrp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-10-2013, 12:21 AM
  5. Finding Median in Series of Numbers for Specific Records
    By vinaykam82 in forum Excel General
    Replies: 3
    Last Post: 12-04-2011, 04:02 PM
  6. Shift x-axis category in histogram
    By rulito in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-22-2009, 10:39 AM
  7. median, frequency or histogram
    By Larry Holt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-11-2006, 10:30 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