I have a chart in Excel 2010, and I want to have a data series that can refer to multiple named ranges based on criteria in another cell. For example, if A1 = 1
, the data series will display the data from S_1
, and if A1 = 2
it will display the data from X_1
. Both S_1
and X_1
are dynamic, and can refer to different data based on other conditions I have.
I've gone into the select data source of the chart, and tried setting the series value of the data series equal to formulas like IF(A1 = 1, S_1, X_1)
, and CHOOSE(A1,S_1,X_1)
, but it says these functions aren't valid.
Is the syntax of the formula off, or does excel not accept these formulas in its series value? If it's the latter, what other way is there to achieve the desired result?