+ Reply to Thread
Results 1 to 6 of 6

Graph to visualize time of day spent working

  1. #1
    Registered User
    Join Date
    10-16-2019
    Location
    Norway
    MS-Off Ver
    365
    Posts
    3

    Graph to visualize time of day spent working

    I have a sheet where on the y-axis, there are the times 20:00 through 07:00 in hour-increments, so 12 columns. on the x-axis i have dates. For each hour on a given date is the number 0, 0,25, 0,5, 0,75 or 1 reflecting the amount of the specific hour that is consumed. I want to make a graph that shows where the different numbers are on the y-axis on the given dates. It is to show when i've worked. Lets say on the 26th of august i worked 20:00 through 23:00 then 00:30 to 01:30 and then 04:15 to 05:00. I then want 1 box for the hour 20-21, on top of that a box that shows 21-22 and then one that shows 22-23, then a GAP up on the y-axis before there is a box on 00:30 to 01:30, then another gap until a box that is 75% of the first one, reflecting hours worked 04:15 to 05:00. Suggestions? :D

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

    Re: Graph to visualize time of day spent working

    What you describe sounds like a basic stacked column/bar chart or a Gantt chart. I'm not sure which parts you will have questions about, but the basic procedure will be:

    1) Compute starting time and durations for each block/stack that you want included in the chart.
    2) Create the chart with the various on/off blocks as a stacked column chart.

    If you are not familiar with Gantt charts (whether using the built in Gantt chart type or stacked column/bar charts), you might review:

    This one shows something very similar. Both chart based on spreadsheet+conditional formatting based approaches are discussed: https://www.excelforum.com/excel-cha...ool-usage.html
    Another example: https://www.excelforum.com/excel-cha...cel-chart.html
    Basic tutorial for building Gantt charts as stacked bar/column charts: https://www.excel-easy.com/examples/gantt-chart.html
    MSFT helpfile for the built in Gantt chart type: https://support.office.com/en-us/art...rs=en-US&ad=US
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    10-16-2019
    Location
    Norway
    MS-Off Ver
    365
    Posts
    3

    Re: Graph to visualize time of day spent working

    Okay, so i have cut out 1 week here, attached,, i have several weeks - can I make one of those Gantt-charts from this?
    Attached Files Attached Files

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

    Re: Graph to visualize time of day spent working

    I expect you can. I think this arrangement (hours and fractions of hours) will be more difficult to work with. Your note says to treat fractions of an hour as if they are the first part of the hour (0.25 means between hr:00 and hr:15), but your example in post #1 and the data for 22 and 23 on 1 Sep suggests that those fractions can also mean last part (or maybe even middle part?) of an hour. For example, your 1 Sep, both 22 and 23 have 0.5 in them. I would guess that this means that you worked from 22:30 to 23:30 rather than 22:00 to 22:30 then 23:00 to 23:30.

    How thoroughly did you review the links I provided? PietBom's example in the second thread (https://www.excelforum.com/excel-cha...ml#post4739736 ) has a template that you can try using that may require minimal modification. Note that he enters start stop times rather than hours and fractions of hours. The only thing I see needing to do with your data is that, because it crosses over midnight into the next day, you need to add 24 hours to your midnight to 9AM times. Try this with his example:

    1) In column A, enter your dates.
    2) Clear columns B to Y so you can enter your values.
    3) In B3, enter 2000. B4, enter 1800, and so on for the first batch of start times.
    4) In C3, enter 2430, C4, enter 1930, and so on for the first batch of stop times.
    5) Continue entering start/stop times (as hhmm numbers) as needed. For start/stop times past midnight, add 2400. So a 1AM start time is entered as 2500. A 2:30 AM stop time is entered as 2630.
    6) Look at the chart and see if it is what you are trying to show.

  5. #5
    Registered User
    Join Date
    10-16-2019
    Location
    Norway
    MS-Off Ver
    365
    Posts
    3

    Re: Graph to visualize time of day spent working

    That chart you linked to is _excatly_ what I want, thank you very much! :D
    I tried to understand the way it was built up and to make my own, but i didn't make it quite. Trying now to just use his example and adding my own times in it. Any suggestions on how to change the y-axis so that it goes from 18:00 to 09:00? Using his extended 4 months example... exepct for the axis it seems to work perfect
    Last edited by bglio; 10-17-2019 at 07:35 AM.

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

    Re: Graph to visualize time of day spent working

    Any suggestions on how to change the y-axis so that it goes from 18:00 to 09:00?
    It should be a simple matter of bringing up the format axis dialog and setting the min (and maybe max) for the axis to the desired values. Unless something has changed, you will need to know the serial number equivalent for those times -- which means reviewing how Excel stores dates and times as serial numbers (http://www.cpearson.com/Excel/datetime.htm if you missed it in the other threads). So, 18:00 is actually entered as 0.75. 9 AM on the following day is 0.375.

    I tried to understand the way it was built up and to make my own, but i didn't make it quite.
    What part did you have trouble with? Recognize that there are 4 general basic programming steps to the spreadsheet:
    1) Enter data as hhmm
    2) manipulate the entered data to convert them to real date/time serial numbers (Part of what is happening in columns AA:AX)
    3) Compute duration of each on/off segment (Also part of the formulas in AA:AX).
    4) Then build the chart.

+ 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. Replies: 1
    Last Post: 06-02-2016, 10:10 AM
  2. Replies: 0
    Last Post: 03-04-2016, 06:38 PM
  3. Calculate time elapsed, excluding time not spent working
    By BREECHEEZ87 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-12-2015, 03:01 PM
  4. Replies: 10
    Last Post: 07-13-2013, 05:20 AM
  5. Pivot/Chart/Graph whatever to visualize dataset
    By Javajawa16 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-09-2013, 09:36 AM
  6. Ideas on how to better visualize Yield % and # in one graph
    By pg300 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 12-09-2011, 12:10 AM
  7. Time Tracker - I need a macro that calculates the time spent on an activity
    By amark in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2011, 09:55 AM

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