We’re improving Formula Genius. We’re redesigning the app and fixing issues along the way. Sorry for any disruption, and thank you for your patience.
Excel advanced

How to Create a Dynamic Chart Data Range in Excel?

Automatically update your chart as new data is added by using the OFFSET function or named ranges for flexibility and efficiency.

Formula Genius can generate a draft from a plain-English prompt. Supported formulas can be checked with sample cases; review the coverage on the result.

The formula

Prompt

"Create a chart data range that automatically includes new rows as data is added, using OFFSET or a named range"

Excel
=OFFSET(Sheet1!$A$1, 0, 0, COUNTA(Sheet1!$A:$A), COUNTA(Sheet1!$1:$1))

This formula creates a dynamic range that expands as new rows are added to the data set.

Step-by-step breakdown

  1. OFFSET function starts at a specified reference point (A1 in this case).
  2. The second and third parameters (0, 0) indicate no rows or columns are skipped from the reference.
  3. COUNTA counts the number of non-empty cells in column A to determine the height of the range.
  4. COUNTA counts the number of non-empty cells in row 1 to determine the width of the range.

Edge cases & warnings

  • Data is added in a non-contiguous manner, causing incorrect range size.
  • Empty rows or columns within the data set may lead to inaccurate counts.
  • Using the formula in a different sheet without adjusting the reference may cause errors.

Examples

Prompt

"Data in A1:A10 with values 1 to 10"

Excel
Dynamic range includes A1:A10
Prompt

"Data in A1:A15 with values 1 to 15, and A11:A15 are empty"

Excel
Dynamic range includes A1:A10

Frequently asked questions

What is the OFFSET function?

OFFSET returns a reference to a range that is a specified number of rows and columns from a cell or range.

Can I use this formula for multiple columns?

Yes, you can adjust the COUNTA function to include multiple columns.

What happens if I delete rows in the data range?

The dynamic range will automatically adjust to exclude the deleted rows.

Can't find what you need?

Describe a formula in plain English. Formula Genius drafts and explains it, and can check supported formulas on sample cases.