How to make a line graph completely ignore blank cells - excel

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

Related

Variable-base column bar graph

I am trying to get a variable-base column bar graph in Excel. Basically, with reference to the figure below, I have a number of periods. Each period can range from 1 to 5 months. So the various periods do not have the same length. Each period, however, has only one value associated with it that is representative of the entire period.
What I wish to achieve can be seen in the first figure (A), where two characteristics that the graph must have are also highlighted, namely, to consist of columns of varying width, as well as height, and to have the final month of the period placed in the center of the column and not at the bottom right.
I have tried several ways to get this graph with Excel, but all I have been able to get is visible in the second figure (B). Basically, I had to create a second, auxiliary, table by hand from the first, and then generate a normal column chart.
Clearly the result is different from what I wanted, although I came close.
Do you think it is possible, with Excel, to get exactly the chart I need without having to use a second table? Or, alternatively, do you think there are other programs, e.g., Holoviews (Python) to get the expected result?

Excel line chart plot multiple y values (series) on same x value

I am trying to plot multiple y values for the same series on the same x value in a line chart across a period of time. As a background, I would like to create a line chart (or scatter plot) of rankings for a particular professor over a period of time. However, the problem lies in that professors teach multiple sections in a given quarter. As a result, I’m unable to utilize a series to encapsulate more than one section for a given period, which results in each section having its own series (as opposed to each professor having their own series that captures all sections they teach). I would like for each professor to show up as one series (i.e., color) across time in the chart. Any help would be great!
final chart

Omitting zeros and shortening x axis automatically in an excel graph

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.

Dynamic number of series in Excel Scatter Plot

I have a data set (2 tables see first screenshot below) which dynamically update both by the rows and columns - and used that to plot XY Scatter, (x values are pulled by the table above, and y values from the table below).
There are 18 series in all, i.e. devices starting from CPAP to X-Ray Machine.
Each series has a dynamic range using the OFFSET function and hence that updating does not give an error on the chart - BUT because the devices itself are dynamic, they can either be only 1 series or all 18 series. When that updates, it results an error on the scatter plot. (see 2nd screenshot).
As you can see from the 2nd screenshot, the series become blanks and returns an error. I want the chart to reflect only that series that are not blanks.
I have a basic understanding of VBA, and so couldnt figure out how to code that functionality in the chart based on the searches I made to find a solution. Would appreciate if someone can help me figure this code!
edit:
Attached is a screenshot with just one device selection (i.e. Pulse Oximeter).
The formula for X values is:
=OFFSET(TDI!$B$12,0,0,1,COUNT(TDI!$12:$12)-1)
and for Y values:
=OFFSET(TDI!$B$36,0,0,1,COUNT(TDI!$36:$36))

Excel scatterplot graph update automatically

My problem is as follows:
The user inputs two numbers between 2 and 25, these numbers are used to create a grid. Every point on the grid has (x,y) coordinates. Based on the amount of points the user chose, my excel sheet is filled up with up to 25x25 (x,y) coordinates.
Example: A 6x7 grid is chosen by the user, the table is filled with 42 (x,y) coordinates and all other values in the table are set to "".
Now I want to use a scatterplot with lines connecting each array to plot the data.
Problem 1: If I only select the 6x7 part of the table that has values in it and create the scatterplot the result is correct. Until the user specifies a different grid, for example 8x9, then the graph is obviously missing two rows and two columns of input data.
Problem 2: If I select the entire 25x25 part of the table, including all the "" values, the graph axes get messed up. The y-axis works properly, but the x-axis shows sequential values (0-7) instead of the x-coordinates.
Problem 3: If I replace all the "" values in the table to 0 or NaN and plot the entire table the axes are correct, but the lines between the scatter data get messed up.
Question:
Is there a way to automatically change the input data for the plot, or is there a way to correctly display the values on the x-axis if I select all the data?
Not sure this will work in your case, but it's worth a try, especially since no one's addressed your post in 3+ hours. I've had success with this approach: 1) charting the largest data set, 2) copying the resulting chart, and 3) trimming the data it draws from to produce all smaller data sets.
To get this to work takes a lot of thought in laying out that largest data set so that all the other plots follow as needed. To illustrate, I've somewhat mimicked your data and in the animated gif I show largest data set, plus 2 others produced by copying it. Then I demonstrate how to make the second one, including the rescaling required to make all plots scaled equally. Notice that I've arranged things so that only one set of x-values feeds all the series. If you can do this, it makes working with the Excel's interface much easier.
After wrestling with it all night I came to the following solution:
Instead of setting all the empty cells to "" or zero the cells should be be set to #N/A (not available). The graph properly ignores the #N/A cells exactly like I want it to and updates when values are entered into them.

Resources