Share via

Graphing function for a variable number of rows

Anonymous
2018-11-26T22:54:10+00:00

Looking for a way to make the number of rows being graphed variable based on the number of rows in the worksheet. My data presently has 221 rows and my series is:

=SERIES('Sheet1'!$A$1,,'Sheet1'!$A$2:$A$221,1)

But what I really want is to have the cell A221 be set based on the number of rows of data like this:

=SERIES('Sheet1'!$A$1,,'Sheet1'!$A$2:$A$NUMROWS,1)

Is there a way to do this?

I am able to display the cell reference I need using the ADDRESS function. The formula

=ADDRESS(COUNTA(A1:A1000),1)

will give me this cell reference $A$221. Trying to use this as part of the SERIES like this

=SERIES('Sheet1'!$A$1,,'Sheet1'!$A$2:(ADDRESS(COUNTA(A1:A1000)),1),1)

produces an error in the formula.

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2018-11-27T15:05:58+00:00

Hi Robert,

How about creating a table to make a chart with dynamic ranges? The following are some steps of my test:

1.Select your data and click Insert>Table.

2.After that, the table should be selected. And you can click Insert>choose a chart type.

3.Add a row in the table, you will find that the chart is changed automatically.

Hope it helps.

Regards,

Zixuan

Was this answer helpful?

0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2018-11-27T18:35:17+00:00

    Zixuan,

    Yes, that works! My data was not explicitly in a table so I first I created a table of the data, and now when I add or delete rows, the range being graphed follows the number of rows. Perfect!

    Thank you very much for your help! Such a simple solution for what was a complicated problem.

    Robert

    Was this answer helpful?

    0 comments No comments
  2. Ashish Mathur 102K Reputation points Volunteer Moderator
    2018-11-27T00:09:52+00:00

    Hi,

    I cannot spot the error.  Sorry.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2018-11-27T00:00:30+00:00

    Thank you for the reply, but Excel indicates "that function isn't valid."

    Was this answer helpful?

    0 comments No comments
  4. Ashish Mathur 102K Reputation points Volunteer Moderator
    2018-11-26T23:25:38+00:00

    Hi,

    Does this work?

    =SERIES('Sheet1'!$A$1,,INDIRECT("'Sheet1'!"&ADDRESS(2,1)&":"&ADDRESS(COUNTA(A1:A1000),1)),1)

    Was this answer helpful?

    0 comments No comments