+ Reply to Thread
Results 1 to 9 of 9

How to group dates into month?

  1. #1
    Registered User
    Join Date
    11-04-2008
    Location
    England
    Posts
    14

    How to group dates into month?

    Hey ppl!

    I am having trouble with having a good display for my line graph to show difference over time, the x-axis is over exhausted with a number of dates...is there a way I can narrow the dates into month form on the x-axis without taking away the accurate date by date data.

    Here is an attached example of my problem if anyone would like to look at it.
    Attached Files Attached Files

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    on my version of your file at least the dates in A are not dates they are text values... I would first create a new range of date values but ensure I have all values dated as 1st of appropriate month.

    First in E2:F13 setup a table of month in mmm format to month number, eg

    E2: JAN
    F2: 1
    E3: FEB
    F3: 2

    etc...

    Then in D1 enter "Date", in D2:
    =DATE(RIGHT(A2,4),VLOOKUP(LEFT(A2,3),$E$2:$F$13,2,0),1)
    copy down for all data in D

    Then highlight B1:D96 and create a Pivot Chart
    Set Date as Row field, Category 1 and 2 as Data Fields
    Set chart type to line or whatever you want.

    Does that do it for you ?

  3. #3
    Forum Contributor
    Join Date
    07-31-2008
    Location
    Berkshire, UK
    MS-Off Ver
    2003 & 2007
    Posts
    118
    I am an excel noob but I would transfer the date values to 2 columns, month in A and date into B, then subtotal and create a graph based on this.

    Sheet attached. I have no doubt that there will be much better and easier ways but I thought I would suggest haha sorry
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-04-2008
    Location
    England
    Posts
    14
    Quote Originally Posted by DonkeyOte View Post
    on my version of your file at least the dates in A are not dates they are text values... I would first create a new range of date values but ensure I have all values dated as 1st of appropriate month.

    First in E2:F13 setup a table of month in mmm format to month number, eg

    E2: JAN
    F2: 1
    E3: FEB
    F3: 2

    etc...

    Then in D1 enter "Date", in D2:
    =DATE(RIGHT(A2,4),VLOOKUP(LEFT(A2,3),$E$2:$F$13,2,0),1)
    copy down for all data in D


    Then highlight B1:D96 and create a Pivot Chart
    Set Date as Row field, Category 1 and 2 as Data Fields
    Set chart type to line or whatever you want.

    Does that do it for you ?
    The bit in bold when entered into D2 comes up within Cell D2: #NA

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    did you create the lookup table in E2:F13 ?

  6. #6
    Registered User
    Join Date
    11-04-2008
    Location
    England
    Posts
    14
    Yes, but I am suppose to be writing the dates in MMM form manually like for instance me writing JAN instead of January?

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    see attached - normally I like people to do it themselves but in this case we could be going to and fro for a bit given it's all a bit of a faff.

    Note Pivot Table & Chart are on sheet 6.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-04-2008
    Location
    England
    Posts
    14
    That chart on sheet 1 is just what I wanted, except instead of having 1,5,9 on the x-axis is there a way I can replace these numbers for the month?

    Example:

    1 = January 2007
    5 = Febuary 2007
    ..etc

  9. #9
    Registered User
    Join Date
    11-04-2008
    Location
    England
    Posts
    14
    I solved the problem late yesterday...I had redone all the dates to data form and not text form so that excel would recognise the dates and then gave me the option to change the scale in graph options.

    Thank You for your help!

+ 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