Dynamic chart range using INDIRECT: That function is not valid (despite range highlighted)

前端 未结 7 1260
太阳男子
太阳男子 2020-11-28 08:20

I\'m trying to create a chart with a range built dynamically using the INDIRECT function. Excel does recognize the range I am creating using INDIRECT

7条回答
  •  佛祖请我去吃肉
    2020-11-28 08:36

    Mine is similar to Sean's excellent answer, but allows a start and end day. First create two named ranges that use Index/Match formulas to pick the begin and end days based on E2 and E3:

    rngDay

    =INDEX(Sheet1!$A:$A,MATCH(Sheet1!$E$2,Sheet1!$A:$A,0)):INDEX(Sheet1!$A:$A,MATCH(Sheet1!$E$3,Sheet1!$A:$A,0))
    

    rngValue

    =INDEX(Sheet1!$B:$B,MATCH(Sheet1!$E$2,Sheet1!$A:$A,0)):INDEX(Sheet1!$B:$B,MATCH(Sheet1!$E$3,Sheet1!$A:$A,0))
    

    You can then click the series in the chart and modify the formula to:

    =SERIES(Sheet1!$B$1,Sheet1!rngDay,Sheet1!rngValue,1)
    

    enter image description here

    Here's a nice Chandoo post on how to use dynamic ranges in charts.

提交回复
热议问题