Chart or Graph data based on hours

vullkunnraven

New Member
Joined
Oct 28, 2009
Messages
5
Question:

I would like to chart (pie or graph) sales based on the hour they occured.

In excel, I have column A - the time stamp, and column B, the sale. Note that each sale has its own unique time stamp.

Any idea how to express this visually? I don't mind rounding down to the hour.

Thanks!!!


<table style="border-collapse: collapse; width: 131pt;" width="175" border="0" cellpadding="0" cellspacing="0"><tbody><tr style="height: 15pt;" height="20"><td style="height: 15pt; width: 83pt;" width="111" height="20">Time</td> <td style="width: 48pt;" width="64">Sale</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">5:02:37PM</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">9:52:09AM</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">5:10:15PM</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">10:30:29AM</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">11:31:31AM</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">4:40:41AM</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">5:28:48AM</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">7:08:34AM</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">5:04:07AM</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">11:50:01AM</td> <td align="right">1</td> </tr> <tr style="height: 15pt;" height="20"> <td class="xl65" style="height: 15pt;" height="20">9:48:58PM</td> <td align="right">1</td> </tr> </tbody></table>
<table style="border-collapse: collapse; width: 131pt;" width="175" border="0" cellpadding="0" cellspacing="0"><col style="width: 83pt;" width="111"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 15pt;" height="20"> <td style="height: 15pt; width: 83pt;" width="111" height="20">
</td><td style="width: 48pt;" width="64">
</td></tr><tr style="height: 15pt;" height="20"><td class="xl63" style="height: 15pt;" height="20">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td class="xl63" style="height: 15pt;" height="20">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td class="xl63" style="height: 15pt;" height="20">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td class="xl63" style="height: 15pt;" height="20">
</td><td align="right">
</td></tr><tr style="height: 15pt;" height="20"><td class="xl63" style="height: 15pt;" height="20">
</td><td align="right">
</td></tr></tbody></table>
 
To gather up the sales for each hour, the following will work:

Book1
ABCDEFG
1TimeSaleStart of HourEnd of HourCategory NamesSales this Hour
25:02:37 PM112:00 AM1:00 AM 0
39:52:09 AM11:00 AM2:00 AM 0
45:10:15 PM12:00 AM3:00 AM 0
510:30:29 AM13:00 AM4:00 AM 0
611:31:31 AM14:00 AM5:00 AM4:00 AM1
74:40:41 AM15:00 AM6:00 AM5:00 AM2
85:28:48 AM16:00 AM7:00 AM 0
97:08:34 AM17:00 AM8:00 AM7:00 AM1
105:04:07 AM18:00 AM9:00 AM 0
1111:50:01 AM19:00 AM10:00 AM9:00 AM1
129:48:58 PM110:00 AM11:00 AM10:00 AM1
1311:00 AM12:00 PM11:00 AM2
1412:00 PM1:00 PM 0
151:00 PM2:00 PM 0
162:00 PM3:00 PM 0
173:00 PM4:00 PM 0
184:00 PM5:00 PM 0
195:00 PM6:00 PM5:00 PM2
206:00 PM7:00 PM 0
217:00 PM8:00 PM 0
228:00 PM9:00 PM 0
239:00 PM10:00 PM9:00 PM1
2410:00 PM11:00 PM 0
2511:00 PM12:00 AM 0
Sheet1


Then you can graph it. The column F formulas allow you to create "blank" series names so that the gaps between data in a pie chart don't get labels. To gain the benefit, discard the labels Excel wants you to use, and instead use the XY Chart Label utility (which isn't just for XL type charts). If it were me, I think I would use a column chart instead. The image below is the result of graphing your sample data in both formats. The column chart gives you an instant feel for what time of day sees the bulk of the sales. The pie chart does not. Also, the pie chart encourages your audience to group the data falsely. It appears that 11am, 5pm, and 9pm form a group, just because their wedges are adjacent. In the column graph, it is more clear that those data points are separated by several hours, and should not be considered a group. You could achieve some better results with color selection, but in the column chart you don't have to work for it.

4275985516_c5a77994a8_b.jpg
 
Last edited:
Upvote 0
I have a very similar issue in which I am needing the above example to display information where Column B would either be 7008, 7009 or 7018 to represent three inbound lines. For example:


A B
Hour Ext
0:14 7018
0:45 7018
1:30 7018
1:34 7008
1:35 7008
2:57 7009


I have everything else nearly the same as the example above but I can not make "Column G" display only if the equivalant of B is equal to one of those ext's (7008, 7009 or 7018).


Any sugestions?
 
Upvote 0
If you put the number 7008 in cell F1, then this formula can go in cell F2 and copy down: =SUMPRODUCT(--($A$2:$A$25>=$D2),--($A$2:$A$25<$E2),--($B$2:$B$25=F$1))

This will give you the number of 7008's in each hour. Do this for each Ext number, then sum the rows. Or don't sum, and graph as a stacked column so you can see that 7008 was a bigger or smaller share of the 8am calls, etc.
 
Upvote 0
Would this still be applicable for A:A (the entire column some days have 1500 calls and other days have 800 calls. I do plan on making a stacked graph to show each ext throughout the day. I just haven't really been in excel for a few years this deeply. Thanks for the help.
 
Upvote 0
You can use a formula that goes beyond the number of cells you're likely to find data in, but this formula returns an error when applied to an entire column. Try something like this small sample:

Book1
ABCDEFGH
1HourExtStart of HourEnd of Hour700870097018
20:14701812:00 AM1:00 AM102
30:1571031:00 AM2:00 AM311
40:2770082:00 AM3:00 AM020
50:3973043:00 AM4:00 AM000
60:4570184:00 AM5:00 AM200
70:5871035:00 AM6:00 AM001
81:1173046:00 AM7:00 AM000
91:2171037:00 AM8:00 AM000
Sheet1


Not shown in this post is the data down to row 25, but the formula is looking all the way to row 2500. The empty rows just get ignored, and the right numbers get calculated.
 
Upvote 0
I went through this this morning as I was swamped yesterday and it comes up with 0 and an error for refering to empty cells. Can the difference be that I have other info in the cells between Column C Column J. Column D is actually Column J on my file and I have changed the appropriate reference cells accordingly in the formula but still am not getting the correct number. Thanks in advance for you help and time. If anything can I send you an example via email to help?
 
Upvote 0
Best to keep it in this thread so others can jump in. What you can do is download the Excel Jeannie utility and post a part of your sheet to the board.

When you say you're getting an error, do you mean an incorrect answer, or something like #N/A or #VALUE!
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top