chart timestamped data, but need excel to "fill in" the times

eric81

New Member
Joined
Jul 7, 2011
Messages
3
Hello,
I have timestamped data of a door open/closed status. I only note the changes, so the data looks like this. 1 is open, 0 is closed.

7/23/2016, 10:10:34

1
7/23/2016, 10:10:38
0
7/23/2016, 10:10:39
1
7/23/2016, 10:10:40
0
7/23/2016, 10:11:41
1
7/23/2016, 10:11:42
0

<colgroup><col><col></colgroup><tbody>
</tbody>

I want excel to generate a chart that lets me visualize the open/closed periods. I want to visually see how long the door is opened during the period. So I need excel to fill the y-value from one time stamp to the next change with the state. So from 10:10:34 to 10:10:37, I need excel to fill in 1's.

A line graph might work, but really anything that visulizes it would work. Bars, lines, whatever.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I think you'll find a column chart is easiest to read and is much less work.

Column Chart
I'm only posting a portion of the data I used for the chart; I expanded what you posted.

R9Ev8Os.png


Excel 2012
ABCDEF
1DateTimeOpen/CloseDuration
207/23/201610:10:34110:10:343
307/23/201610:10:370
407/23/201610:10:39110:10:391
507/23/201610:10:400
607/23/201610:11:41110:11:413
707/23/201610:11:440
807/23/201610:14:32110:14:3221
907/23/201610:14:530

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
E2=IF(C2,B2,"")
F2=IF(C2,(B3-B2)*86400,"")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Scatter chart
This is much more difficult for me to read.

ebe7ESY.png


Cell H2 was entered manually. The remainder of the column was populated by formula. Columns E and H were graphed.

Excel 2012
ABCDEFGH
1DateTimeOpen/CloseTimeStartEndOpen
207/23/201610:10:34110:10:34101
307/23/201610:10:37010:10:35001
407/23/201610:10:39110:10:36001
507/23/201610:10:40010:10:37010
607/23/201610:11:41110:10:38000

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
F2=IFERROR(--(INDEX($C$2:$C$19,MATCH(E2,$B$2:$B$19,0))=1),0)
G2=IFERROR(--(INDEX($C$2:$C$19,MATCH(E2,$B$2:$B$19,0))=0),0)
H3=IF(F3=G3,H2,IF(F3,1,0))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,442
Members
448,898
Latest member
drewmorgan128

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