+ Reply to Thread
Results 1 to 10 of 10

Formatting grouped horizontal axis of Pivot Chart

  1. #1
    Registered User
    Join Date
    02-14-2009
    Location
    Bristol, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Question Formatting grouped horizontal axis of Pivot Chart

    Hi, I've got time-based data and I'm using a PivotTable to smooth data collected daily by grouping by in 7 day intervals and taking an average. I've plotted the smoothed data, but the axis shows each of the 7-day periods instead of the year as I would like (see "Problem Outline" attachment). I have tried to apply custom number formatting, but this appears to be ineffective (see "Ineffective Number Formatting" attachment). I've attached the actual spreadsheet in case it's of any help. I'm using Excel 2010.

    Thanks.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Formatting grouped horizontal axis of Pivot Chart

    The number format will not affect the axis as the combined dates are now simply text.

    The best you can get is to add Year to the grouping. This will give you multi level axis labels with the year displayed below dates.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    02-14-2009
    Location
    Bristol, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Formatting grouped horizontal axis of Pivot Chart

    Thanks Andy, but adding Year to the grouping means that you cannot group days in lots of 7 (see attachment), and so the data is no longer smoothed. I suppose this would make sense because a new year could fall midway through a 7-day interval.

    But after more than 2 decades of development on Office to date and my wallet £200 lighter from its purchase, I'd have hoped that a simple axis formatting isn't too much to ask from Microsoft. Surely there must be some way to achieve my desired result?

    Thanks again.
    Attached Images Attached Images

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Formatting grouped horizontal axis of Pivot Chart

    Sorry I did not see that it reverted to 1 day grouping.

    You may have to create a normal chart in order to get the exact formatting you want.

  5. #5
    Registered User
    Join Date
    02-14-2009
    Location
    Bristol, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Formatting grouped horizontal axis of Pivot Chart

    Thanks Andy - I thought of a possible solution by adding an extra column containing the year of the date in the dates column. This has allowed me to group by year then by 7-day interval as you had previously suggested. However, now, although the year displays as desired on the chart's horizontal axis, how can I remove the labelling of the 7-day interval subgroup (see "Subgroup-Labels Problem" attachment)?

    The updated spreadsheet is also attached for reference. Thanks again.
    Attached Images Attached Images
    Attached Files Attached Files

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Formatting grouped horizontal axis of Pivot Chart

    As I said I think you will need to build a normal chart based on data derived from the PT.

    I have changed the layout of the row labels slightly in orde to make the formula easier.

    The chart is then based on the formula based data.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-14-2009
    Location
    Bristol, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Formatting grouped horizontal axis of Pivot Chart

    Thanks for your help Andy. The chart is looking good, however, how can I move the horizontal axis labels closer to the axis (see attachment)? I realise it's because it's part of multi-level category labels, but turning that option off removes the top level category labels (Years) which is what I need to keep instead of the lower level (Weeks displayed as " ").

    Thanks for your help.
    Attached Images Attached Images

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Formatting grouped horizontal axis of Pivot Chart

    If you change the category axis range to be just the first column of data you will get only the years displayed close to the axis. But the spaces will also be displayed. This means the year values are wrapped and appear on the first point rather than in the middle of a years worth of data.

    You can set the alignment to vertical in order to avoid label wrap.

  9. #9
    Registered User
    Join Date
    02-14-2009
    Location
    Bristol, England
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Formatting grouped horizontal axis of Pivot Chart

    Thanks Andy - what do you mean by "change the category axis range"? How do I do this? Thanks.

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Formatting grouped horizontal axis of Pivot Chart

    Change the cells used for category labels to be

    ='NavParDil (Ex-Income) PivotTabl'!$H$5:$H$269

    instead of ='NavParDil (Ex-Income) PivotTabl'!$H$5:$I$269

    See attached.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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