difficult graph ?

  • Thread starter Thread starter kyrbi
  • Start date Start date
K

kyrbi

Hi friends
I want to create a time frame chart to see when a system was up or down (1
or 0)
I have this information:

Start time process time systemnr
8u10 15,5 min 1
8u20 10,5 min 2
8u35 13,0 min 1
9u10 18,5 min 2
9u25 09,5 min 1
10u05 05,0 min 1

I want a graphs with 2 time lines (per system) showing me up or down time
Is this possible?

sample:

|
|_°°°°°__°°_°°°°°°°°____°°°°°
| 8u 9u 10u


Thanks a lot
Vanessa
 
Not to hard, if you don't mind a few formulas.

Here is the range A3:C8. I've formatted all times as h:mm:ss and made
sure that is how they are entered.

8:10:00 0:15:30 1
8:20:00 0:10:30 2
8:35:00 0:13:00 1
9:10:00 0:18:30 2
9:25:00 0:09:30 1
10:05:00 0:05:00 1

A: Start of Up time
B: Length of Up time
C: System Number

We'll use column A for X values of an XY Scatter chart, and column B for
the X error bars. For Y we need a formula. In D2 put 1 and in E2 put 2.
In D3 put this formula

=IF($C3=D$2,1,NA())

and in E2 put this formula

=IF($C3=E$2,1.1,NA())

Fill these formulas down to row 8. This puts a 1 in column D if column C
has a 1, and it puts a 1.1 in column E if column C has a 2. So column C
is for system 1 and column D for system 2, and I offset system 2 up by
0.1 so they don't obscure each other.

Select A2:A8 (yes, include the blank cell), then hold down Ctrl while
selecting D2:D8. Start the chart wizard and make an XY Scatter chart (a
Line chart will not work). So you have two sets of points. Double click
the first one, click on the X Error Bar tab, click in the Custom + box,
and select B3:B8 with the mouse. Do the same for the other series.
Format the points to be invisible (no lines, no markers) and format the
error bars with distinctive colors, and no cross at the end. For some
people this might be enough, a line where each system was on. But I can
tell you're a demanding engineer who needs more.

So add Y error bars to both of these series, using a constant value of
-1. This gives you a total of half of a step chart. You need formulas to
get the rest, which we'll get by adding two more series.

Column F will be the X values. Put this formula in F3 and fill it down
the column

=A3+B3

Column G is a helper column, which has this formula

{=IF(ISNUMBER(D3),MIN(IF(ISNUMBER(D4:D8),A4:A8)),MIN(IF(ISNUMBER(E4:E8),A4:A8)))}

Don't type the curly braces. Hold down Ctrl+Shift while pressing Enter,
and Excel makes it into an array formula, signified by the braces.

Column H is our new X Error Bar values, and H3 has this formula

=IF(G3>F3,G3-F3,0)

Put 1 into I2 and 2 into J2. Put this formula into I3

=IF($C3=I$2,0,NA())

and this into J3

=IF($C3=J$2,0.1,NA())

and fill all formulas down.

Select F2:F8 (including the blank cell), and hold Ctrl while selecting
I2:J8. Choose Copy from the Edit menu, select the chart, and choose
Paste Special from the Edit menu, and paste the data as new series,
categories in first column, names in first row.

Using the techniques described above, apply the range H3:H8 as positive
X error bars to both new series, and apply positive error bars of
constant value 1 to both. Format all your error bars so both series for
system 1 share a color, as do both for system 2.

Phew!

- Jon
 
Hi Jon,

thanks for your "simple?" answer!
it looks ok, but I don't get the x-error bars visible....
only if I use y error bars I can see them, but not when I use x-error bars.

any idea?
can I send or post an example excel file?

Thanks a lot!
Vanessa
 
Do you mean you don't see the option to add X Error Bars? Change the chart to an XY Scatter chart, as I specified. It is the only kind of chart that allows X Error Bars.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
http://PeltierTech.com/Excel/Charts/
_______

----- kyrbi wrote: -----

Hi Jon,

thanks for your "simple?" answer!
it looks ok, but I don't get the x-error bars visible....
only if I use y error bars I can see them, but not when I use x-error bars.

any idea?
can I send or post an example excel file?

Thanks a lot!
Vanessa
 
Hi,

I can see & setup the options, but I cannot see them in the graph, I don't
see the lines...

Thanks

Jon Peltier said:
Do you mean you don't see the option to add X Error Bars? Change the chart
to an XY Scatter chart, as I specified. It is the only kind of chart that
allows X Error Bars.
 
You don't see the series lines? Or the Error bar lines? I neglected to
say I set up the Y axis with min=-0.1, max = 1.2, spacing = 0.1, and no
gridlines, so the error bars were not obscured by the axes or gridlines.

- Jon
 
Back
Top