Omitting zeros and shortening x axis automatically in an excel graph - excel

I have a data set of time periods (in this case 16, but I would also need this to work for much larger ranges), which will have a set of values starting at a random period and ending at a random period. The data will either be a value or a zero, and it will not be intermittent.
So for example it could run 0,0,0,0,10,12,12,11,14,16,0,0,0,0,0,0 or 0,0,10,12,12,11,14,16,0,0,0,0,0,0,0,0. Or any other combination, including there being a value in every period.
The data is in a table with the time period in one column and the value in the next column.
Is it possible to have excel set up to automatically plot the data in a line graph, but to not plot the zero values *and automatically shorten the x axis to fit**emphasized text*.
So in the examples above the x axis would start at the first time period with a value (10) and finish at 16.

You could try using a pivot chart and omitting the zeros in the chart data.

Related

Excel Scatter plot x-axis automatically reverting to 0 when range gets a certain size

I am making an XY scatter plot and error lines to make a sort of timeline, the dates along the x axis. This works wonderful but when the range of the data gets a certain length, the minimum on my scatter plot resets to zero instead of the automatic a setting of a few days before the earliest date. Why does the scatter plot do this and how can I correct it. Ideally, the form will just always set the minimum to the earliest date. I know I can change it manually, but I am preparing this for a lot of users and really need this to set itself automatically and stay there.
Data set
What happens when I enter the next date
New Data set

Gnuplot: calculated X tic labels for data file without X column [duplicate]

I'm plotting a column of data which represents a time series in gnuplot. Every value represents a time value after 500 iterations / time units. Can I tell gnuplot to multiply the x-values it displays by 500?
I thought this would be a standard problem since every time one has to plot a time series one needs to tell the plotting program what time unit each iteration has.
I don't want to create an extra column with x-values manually, since I have a lot of different data of different length. I don't want to create a x column for everyone of them.
If you have only a single column, gnuplot uses the row number as x value. This can be accessed by the pseudo column 0 and scaled like
plot 'datafile' using ($0*500):1
or equivalently, if you're calling this from a shell script
plot 'datafile' using (column(0)*500):1

How to make a line graph completely ignore blank cells

We have a graph showing the aggregate performance of a fund versus the S&P 500 since a class began. As it stands, I have to readjust the data selection of the graph every week to plot the new week's data. I've already spent more time trying to automate this than it would have taken me to change it every week for the whole year, but this is more of a personal goal and learning experience for me. I tried a number of solutions from here but they were unsuccessful.
Here is what the graph is supposed to look like:
Original
That is when the data selection is limited to the values we already have. The data on the page is sourced from an input page where I enter in two values every week that give the data for the graph. If I leave the y values empty, with the dates still there, it plots the dates, and it plots the empty y values as zero.
Using an IF function, I made it so the X value only appears if there is a value for Y. The graph still plots the blank X and Ys.
I tried having the IF function return #N/A instead. This finally stopped the Y values from plotting (you can tell because the graph doesn't go to zero) but it still plotted #N/A for x values for some reason.
Using #N/A

Dynamic Milestone Trend Analysis Graph needs same y-axis as x-axis in Excel with VBA

After a couple hours of work I come to you guys with this graphing problem. I need to create a Milestone-Trend-Analysis which can be seen on the german wikipedia , though not in the english version.
General Information
In short, the diagram has report dates on the x-axis (for now, on every first of the month, another report is due).
The y-axis should mirror the x-axis completely. In length and also the tickmarks. The dates get bigger from the bottom to the top.
In my case the x-Axis is on top of the diagram.
Every report consists of a number of "due-dates", one for each assignement in progress. They are the estimated "finishing dates" of that particular assignement.
If the estimated finishing date stays the same in the next report period, the graph for that assignement stays on the same level. If the estimate is earlier, the graph trends down. Normally they go up, since the assignement has some delay :-D
The x-axis needs to be dynamic, since the whole project is basically finished when its last assignement is finished. If one of the assignements is running late, the whole project gets delayed an thus the x-axis needs to be longer/get more ticks.
Since the y-Axis mirrors that, it has to change too.
MY PROBLEM
The x-axis has a number of discreet values, since the reports come in every month, or every two weeks. But that does not change.
The values for the finishing dates are continuous, since the assignements can be terminated whenever.
That leaves me with the problem of having to cut the y-axis in equal-size chunks, although the months of the year are not equal in size. At least that is, what I think excel forces me to do.
I can assign a max limit and a min limit for the y-axis and I can assign a distance between each main tickmark. Since Excel works with a continous number for each date, the 2014/01/01 would be 41640. And 2015/01/01 is 42005. Since I have 12 month on the x-axis and I need 12 on the y axis, I would have to have the main Ticks at a distance of 30.42 ... which gives me the following Months on my axis
January January March .... December December
Does anyone know an answer for this? Is there a way to have excel make the tickmarks on the y-axis not equal distance?
Any input greatly appreciated.
Kaz
I did not find a way to make Excel have variable tick mark distances. But since I coud not have it that way, I had to make the month equally long.
This works for me now:
'calculate the norm for different type of month including Schaltjahr
Select Case cellMonth
'February
Case 2
'Schaltjahr and Schaltjahrhundert
If (cellYear Mod 4 = 0) Or (cellYear Mod 400 = 0) Then
resultDay = (30 / 29) * cellDay
Else
resultDay = (30 / 28) * cellDay
End If
'31 day months
Case 1, 3, 5, 7, 8, 10, 12
resultDay = (30 / 31) * cellDay
'30 day months
Case Else
resultDay = cellDay
End Select
Now I just have to scale the axis to numberOfMonths * 30. It now leaves adjusting the names of the y-Axis, which seems to be a whole different story.
Kaz
You can put arbitrary labels along the Y axis by adding a dummy XY series.
Here is some data that I think captures your issue, plus a line chart showing the data, plus the data that I'll use to construct a dummy Y axis.
I used a line chart so the X axis at least would be easy. You just have to make sure that the axis is formatted as a date axis with Base Unit of Days.
Here is how I built the axis.
Top Left Chart Below: I copied the dummy axis data, both columns of the data includingt the header row. I selected the chart, and used Paste Special to add the data as a new series, data in columns, series names in first row, categories in first column (but don't replace existing categories).
Top Right Chart Below: I right-clicked on the added series, clicked on Change Series Chart Type, and selected XY Scatter with Lines and Markers. Excel also put this series onto the secondary axes.
Middle Left Chart Below: I formatted the added series to be plotted on the Primary axis.
Middle Right Chart Below: I changed the scale of the vertical axis, giving it a minimum of the first date and a maximum of the last (1/1/16 to 9/1/16).
Bottom Left Chart Below: I formatted the vertical axis to show no labels.
Bottom Right Chart Below: Format format format. I formatted the dummy axis series so it used light gary lines (matching the horizontal axis) and light gray cross markers (simulating tickmarks). I changed the tickmarks of the horizontal axis so they crossed the axis, matching the cross markers of the dummy series. I added data labels to the left of the dummy series points, simulating vertical axis labels.

Highlight points on an Excel Line Graph according to a list

I have 2 data series, which records how much a user is meditating/attentive (out of 100) plotted onto a graph. The x axis is the number of seconds since the start of the experiment, and the y axis shows the value for meditation/attention at that point of time.
I have a 3rd set of data that is a series of key timestamps during the experiment (not exactly matching the timestamps from attention/meditation values).
I want to create a graph where you can compare how the attention/meditation values change at the key points
Whether the key points are highlighted by a line or dots I don't care. I tried adding the 3rd data set as a secondary axis, but it still uses the original x-axis of the main graph and I don't know how to make excel do what I want.
Thanks in advance
You should use an XY Scatter chart, not a line chart. A line chart ignores any numerical value in the X values, treats each X value as a text label, and uses the X values from the first series as X values for all series.
You can format the first two series so that they use lines and not markers, and the third so it uses markers without lines.
You may find this link helpful: superuser.com/questions/825692 You don't need to use the secondary axis, just add another series with tag times and constant 45 value, then format vertical error bars to 100% and horizontal to 0%.

Resources