I am attempting to create a chart with a dynamic data series. Each series in the chart comes from an absolute range, but only a certain amount of that range may have data, a
I found a way to do it.
you can do an x,y scatterplot. it will ignore null records (i.e. rows)
Best way is use Empty
Dim i as Integer
For i = 1 to 1000
If CPT_DB.Cells(i, 1) > 100 Then
CPT_DB.Cells(i, 2) = CPT_DB.Cells(i, 1)
Else
CPT_DB.Cells(i, 2) = Empty //**********************
End If
Next i
When you refer the chart to a defined Range, it plots all the points in that range, interpreting (for the sake of plotting) errors and blanks as null values.
You are given the option of leaving this as null (gap) or forcing it to zero value. But neither of these resizes the RANGE which the chart series data is pointing to. From what I gather, neither of these are suitable.
If you hide the entire row/column where the #N/A data exists, the chart should ignore these completely. You can do this manually by right-click | hide row, or by using the table AutoFilter. I think this is what you want to accomplish.
You can use the function "=IF(ISERROR(A1);0;A1)" this will show zero if the cell A1 contains an errore or the real value if it doesn't.
There is another much less known solution which has merit in some places. Use the #NULL! error which does not plot and does not create a zero point for the plot.
So your plot column is filled with the following construct. Assume real data in column A and that the plotted version is in column C.
=If(Isnumber(A2),A2,A2 A3)
That space is a little known operator to produce the intersection of the two cell addresses or ranges. If there is no intersection then it produces the message #NULL!
Cells containing #NULL! are skipped for plotting purposes.
Aside (For Microsoft) just need to get the maths equations to ignore such cells somehow?
If you use PowerPivot and PivotChart, you will exclude non-existing rows.