+ Reply to Thread
Results 1 to 14 of 14

Is there an easy way to create dynamic histograms/frequency diagrams?

  1. #1
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Is there an easy way to create dynamic histograms/frequency diagrams?

    Hello all,

    I managed to create a frequency diagram very easily using the data tab and then the dataanalysis function like this:

    1. Copy my input data to the first column in a fresh sheet.

    2. Create my own intervals.

    3. Use the function above where I select my input data and intervals and voila. Very nice!

    Sadly, these do not seem to be dynamic, such that when I delete data or add new data, it's not updated.

    In order to create a dynamic histogram, am I dependent on setting up the bins/intervals manually and also calculating them manually?

    I'm planning to create multiple sheets where I track certain statistics and I'm imagining to be updating them once every week or so, so I would like to have a solution where I can simply copy in new input data and have the histograms update themselves automatically.

    Thanks in advance!

    PS: Attached is the file I created using the steps above.

    EDIT: http://www.excel-easy.com/examples/histogram.html

    This illustrates the technique I used. Very easy, but sadly not dynamic.
    Attached Files Attached Files
    Last edited by Elijah; 03-28-2016 at 03:37 PM.

  2. #2
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    I may add that I'm creating frequency diagrams of data that is not numerical as well. For instance, I have a statistic with two parameters, "LH" and "HL".

    With this type of data, I couldn't use the function I utilized above anyway since it wasn't numerical, so I solved it by setting up two intervals "LH" and "HL".

    Then, I used the COUNTIF function and managed to count the occurrence of each such that I have the frequency. Now, I could easily make a diagram.

    And this one seems to be dynamic!

    I guess this solves my problem in the first post, but I have a hard time doing the counting when the intervals I set up contain more than one type of value. In those instances, I suppose I would need to find a way to count values greater than/equal to 09:31 and less than/equal to 10:00. For example.

    I like how the function in the first post counts the frequency according to my pre-defined intervals.

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    i think you solved your own problem

    attached is some other methods which "might" work for you as well

    pivot chart would be dynamic if the data is inserted as table does the shape you want but probably not the titles you want
    Attached Files Attached Files
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    humdingaling,

    Thank you very much!

    I like your second sheet, DayLow, the best due to simplicity.

    I suppose my general solution for this and my other sheets would be to:

    1. Input my data in the far left column.

    2. Create my own intervals/bins according to my own criteria.

    3. Count the frequency in my input data for each interval.

    This is in essence what you've done, right?

    My challenge then seems to be understanding or mastering the function you're using to count for each interval. Would you care to explain or give me a link where I can understand this formula?

  5. #5
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    Here's a similar challenge.

    I'm here looking at daily price changes. These range from roughly -4% to +4%. I'm considering perhaps making one sheet for positive changes and one sheet for negative changes. But probably it's best if I can combine them.

    So, I set up the proposed intervals I imagine may be suitable.

    I'm not sure if I should include change = 0% as one single value or if I should include 0% in the first positive interval ranging from 0-1%. Maybe that is better. Then the first negative interval would be from less than 0 to -1%.

    Regardless, the challenge for me is to be able to count each occurence inside each interval. I suppose I may make use of the same formula as you suggested in the first sheet?

    Thanks again.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    heres a basic introduction to countifs

    https://exceljet.net/excel-functions...ntifs-function
    essentially...what it does is
    Count cells that match multiple criteria

    now with regards to your new challenge
    you need to define how the bins are allocated ensuring there isnt any overlap (so you dont double count)

    not quite sure what you want as an output in this case

    attached file with two ways i think you may want it
    if it isnt it just shows you a few more techniques you can use with countifs
    Attached Files Attached Files
    Last edited by humdingaling; 03-29-2016 at 07:42 PM.

  7. #7
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    Thank you very much, humdingaling! : )

    The way you defined the bins is exactly what I had in mind. I will just have to learn how to perform the count function myself. I hope it's okay to ask if I'm stuck.

    Thanks again.

  8. #8
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    Hello again,

    I think I mastered the count function for my purposes. In fact, I've already made quite a few new sheets. So, thanks again! : )

    While working with this, I decided it would be interesting to see the frequency for when BOTH the DayLow and DayHigh occur inside the same interval. Attached is a sheet with High & Low data side by side.

    I suppose the rest of the sheet may be ignored (it's actually a copy of my Day Low sheet with the DayHigh added).

    Maybe this isn't too hard, but right now, I'm thinking it might be kind of advanced. Not quite sure how to attack this problem.

    I'm thinking like this:

    1. I imagine that this is a rare occurence. So, we need to eliminate or ignore all the data where the DayLow & DayHigh is not in the same interval.

    2. Now, count the occurence of each like done earlier. If we somehow can delete/ignore all data which is not in the same interval, this step should be easy as we can count only one of the columns.

    But perhaps these two steps can be combined.

    If this is too advanced, I may decide to drop it. : )

    EDIT: As it is now, the DayHigh & DayLow is paired data, so it's for the same day.
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    not 100% sure what you about same interval
    see attached if it captures what you have said
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    Thank you very much for your sheet. If I'm not mistaken, what you've calculated is whether the Low precedes the High for each day. Right? Actually, it's a useful statistic that I track elsewhere, but not exactly what I meant.

    Here's one day with Low and High side-by-side:

    09:35 | 15:45

    Here, it's clear that the Low is slotted inside the 10:00 interval and that the High is slotted inside the 16:00 interval. So, they happen in separate intervals, right?

    Here's another day:

    09:31 | 09:55

    Here, we can see that both the Low and High (sequence isn't important as it could be the other way around) for the day occurs inside the same interval.

    What I wanted to find out is how often this happen for each interval. Not quite often, I imagine, but it would be interesting to know.

  11. #11
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    I had gone to bed, but suddenly got an idea thinking of this problem.

    Proposed solution:

    1. Format the time, i.e., 10:15 (tt:mm) to tt = 10, for all the time data. In other words, skip the minutes and display data just per each whole hour.

    2. Then, it's easy to check if the Day High and Day Low side by side is in the same interval since you only display time by hour. The cells would have to be equal.

    3. Use a simple what if analysis: if A = B; "1"; "0".

    4. Count each occurence.

    The funny thing is that when I did this, I found 0 occurences. I'd imagine the number might be low, but had never imagined that. In fact, I suspect I may have done something wrong. So I need to see once again tomorrow.

    EDIT: Seems like it's 0 occurences since Excel still seems to be reading the full format, even though only hours are displayed. So that explains it.
    Last edited by Elijah; 03-31-2016 at 06:17 PM.

  12. #12
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    see attached if i understood you correctly

    same interval formula is now
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Text(cell,HH) gives cell in Hours only

    basically put
    if Low AND high is under 10 then count as same interval
    else
    if the ABSOLUTE difference between Low and High is Zero then same interval
    everything else is not same interval

    Formula yields 14 exclusions which i conditionally format to make them easier to find and check if the logic is correct

    ps
    formula should read <= 10 instead of just <
    though it makes no overall difference in this case
    Attached Files Attached Files
    Last edited by humdingaling; 03-31-2016 at 07:55 PM. Reason: formula update

  13. #13
    Forum Contributor
    Join Date
    03-31-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    632

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    Fantastic, humdingaling! : )

    That's exactly what I meant other than me wanting to plot it differently, but that's easy for me to figure out myself.

    The only problem is that when I "activate editing" since it's a downloaded file, I get the error #value! for the column C with the long If analysis formula. I'll see if I can figure it out.

    Thanks again.

  14. #14
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Is there an easy way to create dynamic histograms/frequency diagrams?

    you could start using VBA to insert the formula for you

    however i think if you just use the sheet as template and pull data into this sheet
    that way you dont need to set-up a graph every time as well

+ 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] Is there anyway to create kite diagrams like the one pictured?
    By Sezra in forum Excel General
    Replies: 8
    Last Post: 10-15-2015, 10:09 PM
  2. Histograms with dynamic Bins
    By dustin.accord in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 09-01-2015, 11:10 PM
  3. Creating Histograms and Pareto Diagrams.
    By BigBlue52 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 02-06-2014, 10:57 AM
  4. Making Vector Diagrams/ Line diagrams
    By jaaj in forum Excel General
    Replies: 1
    Last Post: 09-07-2009, 06:01 PM
  5. histograms - frequency and relative frequency?
    By confusedstudent in forum Excel General
    Replies: 2
    Last Post: 02-08-2006, 04:25 AM
  6. Easy Frequency Counts?
    By Thomas Kossler in forum Excel General
    Replies: 1
    Last Post: 04-30-2005, 12:06 PM
  7. [SOLVED] Frequency for Histograms in Excel
    By Jim in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 02-24-2005, 04:06 PM

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