+ Reply to Thread
Results 1 to 8 of 8

Displaying X axis in 20 minute increments and smoothing chart

  1. #1
    Forum Contributor
    Join Date
    06-30-2017
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2013
    Posts
    251

    Displaying X axis in 20 minute increments and smoothing chart

    Hi, I have a chart with that includes a time series (column N) and a value series (column D). I can't seem to figure out two things:

    1) How to display the x axis in 20 minute increments on the chart

    2) How to make the chart look less blocky (I realize there are many datapoints, but is it possible to make the line chart look more smooth)?

    Thanks for any help.
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Displaying X axis in 20 minute increments and smoothing chart

    I'm not sure if this is what you want. On your original sheet I added a small table in columns AF:AG for a VLOOKUP. I use this intormation in Column Q (Rounded).

    The formula in Column Q is: =HOUR(N2)/24+VLOOKUP(MINUTE(N2),$AF$2:$AG$5,2,TRUE)/1440

    I separated the hours from the minutes. I look up the rounded value of the minute using the VLOOKUP. With the TRUE option, VLOOKUP looks for the value and if it finds it, returns the specified column. If it does not find it, it goes up to the row before and uses that data. So it creates a step-function.

    I divided the hours by 24 and the minutes by 1440 (minutes in a day) and came up with a number that can be expressed as a time.

    From here, I was not sure what you wanted to do, so I made a pivot table that averages the values for the 20 minute blocks and charted that. That information is shown on Sheet1.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Forum Contributor
    Join Date
    06-30-2017
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2013
    Posts
    251

    Re: Displaying X axis in 20 minute increments and smoothing chart

    Thanks for the response. In reality, I want to maintain the same data series (so I still want to include all ~7k of the datapoints) and I don't want to change that. I just want to change the labeling on the X axis. I've attached the same document with a simple example (R29:AB42).
    Attached Files Attached Files

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Displaying X axis in 20 minute increments and smoothing chart

    OK, so I have one more helper column, called show, and this time I applied it to the axis.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    06-30-2017
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2013
    Posts
    251

    Re: Displaying X axis in 20 minute increments and smoothing chart

    this is much, much closer as to what I'm after, so thanks for your help. Couple more questions...

    1) What is the thick gray bar immediately above the x axis (it looks a little thicker than what I'd expect)? Is that just a formatting issue I can change or is it required as a function of how the chart is constructed?

    2) Do you know why the spacing between 4:20 and 4:40 seems different than the spacing between the other labels?

  6. #6
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Displaying X axis in 20 minute increments and smoothing chart

    I don't know what that thick gray bar is. It might be the tick marks for all those blank items in the show column.

    As for the compression of the data, that's because there are fewer data points in those ranges. I can't get the chart to treat the axis as a date axis even when checking date axis. It think this is because the null string "" is not a date.

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,814

    Re: Displaying X axis in 20 minute increments and smoothing chart

    If it will help:

    I think the easy answer to question 1, starting at the OP again, is to use a scatter chart rather than a line chart. The steps I took:
    1) Select chart -> change chart type -> Scatter (lines without marker).
    2) The "second axis" data series does not have a range for the "x-values" field, so go into the Select Data dialog -> edit the "second axis" data series -> specify column N as the x values for this series.
    3) The x axis scale is "off", so select the x axis -> format axis -> put suitable values in for the axis limits and divisions, or select auto for all parameters.
    3a) Remember that time in Excel is a fraction of a day. To get 20 minute divisions, compute/convert 20 minutes to fraction of a day (20/60/24=0.0138888888...) and use that value for the desired major/minor unit.

    Is that what you are looking for as far as the axis goes?

    As for question 2 -- making it less blocky, I don't have a good idea. It probably depends on exactly what you don't like about the "blockiness" and what you are trying to show with the chart and such. I could see charting a well chosen subset of the data. Or apply a smoothing algorithm to the data. Right now, the blockiness is an accurate depiction of the complete data set that you have asked Excel to chart. Smoothing the chart means doing something "inaccurate" with the charted data, and you would need to carefully decide exactly what you want to do.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  8. #8
    Forum Contributor
    Join Date
    06-30-2017
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2013
    Posts
    251

    Re: Displaying X axis in 20 minute increments and smoothing chart

    Hi,

    Yes, understand #2. This is for my boss so I'm not exactly sure what he's trying to convey with the chart. One option I presented him with was to alter the frequency of the data and pull it every 10 (or 20) minutes so that the labeling would be a little more intuitive. Ideally, I'd like to use the entire tick by tick series of data (the original one with 7000+ rows), but I know that if the only way to do that cleanly is with a scatterplot (even when adding a line to the plot), he's going to go in a different direction. Thanks for the help everybody.

+ 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. Making a Schedule with 15 minute Increments
    By pstansell in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-22-2016, 06:50 PM
  2. Replies: 2
    Last Post: 02-15-2014, 03:12 PM
  3. Excel and time calulations in 6 minute increments
    By vgsinstructor in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-13-2012, 11:21 AM
  4. [SOLVED] Rounding to 6 Minute Increments for Timesheet
    By JRose0303 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-02-2012, 11:23 AM
  5. Chart: display axis values as a time ever 0.30 minute
    By contaminated in forum Excel General
    Replies: 4
    Last Post: 03-23-2012, 10:23 AM
  6. 1 - 50 calculation by 5 minute increments
    By DigiM4x in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2011, 02:20 PM
  7. Replies: 5
    Last Post: 02-05-2009, 10:47 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