graph problem

dmartin1953

New Member
Joined
Mar 7, 2004
Messages
2
I'm trying to plot some data as a function of time- The data starts at 6pm (day 1) and ends 8 hours later at 2 am the following day (day 2). The graph shows the data startifn at midnight on day 2 followed by a gap from 2 am until 6 pm when the data is plotted from 6 pm until midnight.

i want the data to be shown as an 8 hour run from 6 pm until 2 am. I'm using the Mac version of Excel.

Thanks in advance.
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Derek

Well-known Member
Joined
Feb 16, 2002
Messages
1,592
Hi there, Welcome to the Board

In A1 I put the formula =NOW()
In A2 I put the formula =A1+TIMEVALUE("1:00:00") and scrolled it down.
I then changed the format of column A to h:mm.
This will now give you a continuous chart but will not show the day.
You could use another column in your source to display the day and time together if necessary.

Hope this is of some help

regards
Derek
 

Derek

Well-known Member
Joined
Feb 16, 2002
Messages
1,592
Hi again

It still works for me.
In a new workbook, select a sheet and run this code:

Sub ChartTimes()
ActiveSheet.Name = "Test"
Range("A1:B1").FormulaR1C1 = "=NOW()"
Range("A2:B34").FormulaR1C1 = "=R[-1]C+TIMEVALUE(""1:00:00"")"
Range("A1:A34").NumberFormat = "dd/mmm/yy h:mm"
Range("B1:B34").NumberFormat = "h:mm"
Range("C1:C34").FormulaR1C1 = "=ROW()"
Columns("C:C").NumberFormat = "General"
Charts.Add
ActiveChart.SetSourceData Source:=Sheets("Test").Range("B1:C34")
ActiveChart.Location Where:=xlLocationAsNewSheet
Sheets("Test").Select
Columns("B:B").EntireColumn.Hidden = True
End Sub

This will produce a continuous time chart (as an example). Note that the hidden column B is the actual source of the data and is formatted "h:mm".

Hope this makes it clearer for you

regards
Derek
 

Watch MrExcel Video

Forum statistics

Threads
1,122,521
Messages
5,596,643
Members
414,083
Latest member
Mrsash

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
Top