+ Reply to Thread
Results 1 to 8 of 8

Charting question - How Excel handles dates

  1. #1
    Registered User
    Join Date
    06-10-2012
    Location
    New York, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Charting question - How Excel handles dates

    Hello Excel Forum,

    I recently got XL 2010, switching from 2003, and encountered something new.

    I wanted to plot a series of prices for a security, and of course trading does not occur every day, so there were gaps in the series for non-trading days, making the graph look like a comb with missing teeth.

    I tried a few things and did find solution -- making the axis 'text' rather than 'numbers'. But I have the feeling this patch will cause its own problems in some future graph, so I am wondering why it is XL cannot read the dates 'as is' and leave them as numbers. It feels like a Y2K problem, but on a smaller scale of course.

    Thanks

    JK

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Charting question - How Excel handles dates

    use=na() in the gaps,so put another column next to first then something along the lines of if(isnumber(a2),a2,na()) use that for your source the #na get ignored
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    06-10-2012
    Location
    New York, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Charting question - How Excel handles dates

    Quote Originally Posted by martindwilson View Post
    use=na() in the gaps,so put another column next to first then something along the lines of if(isnumber(a2),a2,na()) use that for your source the #na get ignored
    Thanks for the insight, but that creates a lot of work.

    As I said, the 'native' series exists as five weekdays, then five more weekdays, etc. That is, there are no entries for Saturdays and Sundays in the series, and therefore no 'gaps' in the series on my spreadsheet, but XL corrects the data and inserts phony dates when it makes the graph.

    For a series of 10 years of daily prices, it means I have to 'explode' the spreadsheet and insert 52 x 10 worth of weekend days, plus account for the holidays to get everything right.

    Because I switched from XL 2003, I don't know if this feature is new with XL 2010, or has been there all along.

    I'm eager to hear other solutions, though. Thanks

  4. #4
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Charting question - How Excel handles dates

    Select each of the non adjacent ranges while holding down the Ctrl Key, hit F11 and start from there

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Charting question - How Excel handles dates

    not having 2010 i cant say but i just created a greph of
    date return
    11/06/2012 5
    12/06/2012 6
    13/06/2012 7
    14/06/2012 8
    15/06/2012 9
    18/06/2012 10
    19/06/2012 11
    20/06/2012 12
    21/06/2012 13
    22/06/2012 14
    although it inserts the dates in ,it ignores them and you get a continuously ascending curve
    there must be a setting

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Charting question - How Excel handles dates

    brick wall and head! its a known "bug" it existed in 2007 from micro soft
    Microsoft Excel 2000, Microsoft Excel 2002, and Microsoft Office Excel 2003
    To resolve this behavior, format the axis to be a category axis instead of a time-scale axis. To do this, use one of the following methods.
    Method 1
    If you entered data on the worksheet but did not yet create the chart, follow these steps:
    Select the data on the worksheet that is to be the source data for the chart.
    Click Chart Wizard on the Standard toolbar.
    Make the changes you want in steps 1 and 2 of the Chart Wizard.
    In step 3 of the Chart Wizard, click the Axes tab.
    Click Category under Category (X) axis.
    Continue stepping through the Chart Wizard until the chart is created.
    Method 2
    If you already created the chart, follow these steps:
    Click the chart to select it.
    On the Chart menu, click Chart Options.
    Click the Axes tab.
    Click Category under Category (X) axes and click OK.
    Back to the top
    Microsoft Office Excel 2007
    To resolve this behavior, format the axis to be a text axis instead of a date axis. To do this, follow these steps:
    Right-click the axis that you want to change, and then click Format Axis.
    In the Format Axis dialog box, click Axis Options.
    Under Axis type, click Text axis, and then click Close.

  7. #7
    Registered User
    Join Date
    06-10-2012
    Location
    New York, USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Charting question - How Excel handles dates

    Hello Pepe LeMoko,

    I think it must be something about the 2010 version. It's a truly illogical feature.

    Thanks for your note. By the way, I loved your 1937 film.

  8. #8
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Charting question - How Excel handles dates

    Quote Originally Posted by johnekeefe View Post
    By the way, I loved your 1937 film.
    You're the first one to react on that ! Congrats !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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