Google Sheets chart data range can currently (November 2021) only be a range reference such as Sheet2!A1:A8
or a list of range references such as A1:A8, C1:C8
. It cannot be a calculated array such as a formula result, nor a named range.
One consequence of this limitation is that the data range will always get adjusted when you insert or delete rows within the data range.
To plot just the first 8
values in column A
, put this formula in the first row of a free column:
=filter(Sheet1!A:A, row(A:A) <= 8)
Then use the new column as the data range for your chart. If you place the formula in a new tab where no rows get inserted or deleted, the chart's data range will no longer get adjusted when you insert or delete rows in the source sheet.
If you place the formula in the same tab as the source data, the data range will still get adjusted when you insert or delete rows within the first eight rows, but it should not matter, since the rest of the rows will be truly blank and thus get ignored by the chart.
Your indirect()
formula will work the same way, but it is a volatile function that gets recalculated every time any value in the spreadsheet changes. It is better to use filter()
or another non-volatile when possible. See these optimization tips.