+ Reply to Thread
Results 1 to 13 of 13

Plot time against Weekday

  1. #1
    Registered User
    Join Date
    04-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    7

    Plot time against Weekday

    I have 2 colums, colum A with Weekday (monday-sunday) calculated from date's. In colum B I have a different time for each row. My data consists of a few weeks and i'm not really interested in the date itself but more in the moment in the week. The time are times from posted tweets. What I want is to create a graph that shows on which moment in the week tweets were post, so the 7 days on the X-axis and the time on the Y-axis, this way I can see if people are more active on Twitter during weekends or evenings instead of during working days or during the day.

    Thanks!

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Plot time against Weekday

    Sounds like something that would work well with pivot tables. Can you upload an example of what your data looks like?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    04-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Plot time against Weekday

    Here is an example
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Plot time against Weekday

    Okay, first, you need to convert your times to numbers (they are formatted as text).
    Select column B, Data>Text To Columns>Finish

    Next, Create a Pivot Table
    Insert Pivot Table > Pivot Chart
    Select your data range including headers, I selected in same spreadsheet. "OK"

    Drag Weekdays to Row labels, then Time to Row Labels, then Time to Values
    In the pivot Table, right click on a weekday and "Field Settings" > Layout and Printing>"Show Item in Tabular Form"
    Right click on a time and "Group"> Unselect whatever is selected and select "Hour"

    That should do it. (I changed the graph from a column graph to line graph)
    See attached.
    Is that what you are looking for?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Plot time against Weekday

    Thanks for your reply. It helped me going, but it hasn't fully solved my problem yet. Because I want to be able to add a second line into the same graph to compare two different datasets, but this is not possible (I think because the width of the x-axis is not equally distributed?)

    Thanks for your help so far!

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Plot time against Weekday

    Can you give an example of what you are talking about?

  7. #7
    Registered User
    Join Date
    04-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Plot time against Weekday

    Attached is an example of what I mean. Basically it's the same, only now I have 2 datasets (colum A&B and colum C&D). I want both datasets to be in the same graph with 2 different lines.
    Attached Files Attached Files

  8. #8
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Plot time against Weekday

    can you add a dataset identifier so that you have both series in one table of 3 columns?
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Plot time against Weekday

    I used CountIf's to create the PivotTable-like results and then created a graph from that. I'm not sure how to get the x axis to work properly but am getting there.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    04-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Plot time against Weekday

    I managed to do it! I added a number (1 and 2) for the different datasets as a new variable and just pasted the 2nd dataset under the first 1, than created 1 pivot table out of that and used that to create the chart. Only (small) problem remains that the scaling isn't quite right, because it only scales for the values that it has in the dataset, so not with equal intervals (24h/day).
    Attached Files Attached Files

  11. #11
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Plot time against Weekday

    set the time field to show items with no data, filter out the <0/1/1900 and >0/1/1900 entries and then set the chart to join up the gaps if you want.

  12. #12
    Registered User
    Join Date
    04-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Plot time against Weekday

    I'm not sure how to do that, because the Pivot table gets the time values from the dataset, so if the appropriate time values don't exist in the dataset, can it that still show them? (for example monday 2 am is not in the dataset, can it that still be displayed in the table, with 0 matches.)

  13. #13
    Registered User
    Join Date
    04-24-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Plot time against Weekday

    Never mind, i figured it out! Great, thanks for all the help I've got!

+ 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