Dynamic Tables in Excel

Dynamic in itself means a process or system characterized by a constant change or change in any activity. Similarly, in Excel when we create listsExcel When We Create ListsA list can be created in Excel to define a list of items/values as predefined values. It may be created using the Data Validation tool so that users may select from a list rather than entering their own values.read more or data in a workbook and make a report out of it. But if we add any data or remove one or move or change the data, then the whole report can be inaccurate. Excel has a solution for it as dynamic tables.

Now, why do we need dynamic range or dynamic tables? The answer is that whenever a list or data range is updated or modified, it does not make certain that it will change the report as per the data change.

There are two main advantages of dynamic tables:

  • A dynamic range will automatically expand or contract as per the data change.The PivotTables based on the dynamic table in Excel can be automatically updated when the pivot is refreshedPivot Is RefreshedTo refresh pivot tables, you may use the following methods - refresh pivot table by changing data source, refresh pivot table using right click option, auto-refresh pivot table using VBA Code, refresh pivot table when you open the workbook.read more.

How to Create Dynamic Tables in Excel?

There are two basic ways of using dynamic tables in excel – 1) Using TABLES and 2) Using the OFFSET function.

#1 – Using Tables to create Dynamic Tables in Excel

Using tables, we can build a dynamic table in excel and base a pivot over the dynamic table.

Example

We have the following data,

If we make a pivot tableMake A Pivot TableA Pivot Table is an Excel tool that allows you to extract data in a preferred format (dashboard/reports) from large data sets contained within a worksheet. It can summarize, sort, group, and reorganize data, as well as execute other complex calculations on it.read more with this normal data range from A1:E6, then if we insert data in row 7, it will not reflect in the PivotTable.

So, we will first make a dynamic range.

#2 – Using the OFFSET Function to create a Dynamic Table in Excel

We can also use the OFFSET FunctionOFFSET FunctionThe OFFSET function in excel returns the value of a cell or a range (of adjacent cells) which is a particular number of rows and columns from the reference point. read more to create dynamic tables in Excel. Let us have a look at one such example.

  • We must first select the data, A1:E6. Now, in the “Insert” tab, we need to click on the “Table” under the “Tables” section. Next, we have to select the data. Then, in the “Insert” tab under the Excel “Tables” section, click on “PivotTable.” As a result, a dialog box will pop up, as shown below, then click “OK.” As our data has headers, we must remember to check the box “My table has headers” and click “OK.” Now, our dynamic range is created As we have created the table, it takes a range as Table 2. Click on “OK,” and in the “PivotTable,” drag “Product” in rows and “Sales” in values. In the sheet where we have our table, we must insert another piece of data on the 7th. Refresh the pivot table.Our dynamic PivotTable has automatically updated the “Product 6” data in the PivotTable.

Refresh the pivot table.Our dynamic PivotTable has automatically updated the “Product 6” data in the PivotTable.

We have a price list for the products we use for our calculations.

First, we need to select the data and give it a name.

Whenever we refer to the data set price list, it will take us to the data in the range B2:C7, which has our price list. But if we update another row to the data, it will still take me to the range of B2:C7 because our list is static.

We will use the OFFSET function to make the data range dynamic.

#1 – Now, under The “Formulas” tab in the “Defined Range,” we must click on “Define Name,” and a dialog box will pop up.

#2 – We can type any name in the Name BoxName BoxIn Excel, the name box is located on the left side of the window and is used to give a name to a table or a cell. The name is usually the row character followed by the column number, such as cell A1.read more. We will use the “Product.” The scope is the current workbook, and currently, it refers to the current cell selected, which is B2.

In “Refers to” we must write the following formula:

=offset(Sheet2!$B$2,1,0,counta(Sheet2!$B:$B)-1,2)

=offset(

#3 – Now, we must select the starting cell, which is B2.

#4 – Now, we need to type 1,0 as it will count how many rows or columns to go.

#5 – Now, we need it to count the data in column B and use that as the number of rows so that we may use the COUNTA functionUse The COUNTA FunctionThe COUNTA function is an inbuilt statistical excel function that counts the number of non-blank cells (not empty) in a cell range or the cell reference. For example, cells A1 and A3 contain values but, cell A2 is empty. The formula “=COUNTA(A1,A2,A3)” returns 2. read more and select column B.

#6 – As we do not want the first row, the product header, to be counted, so (-) 1 from it.

#7 – Now, the number of columns will always be two, so we must type “2” and click “OK.”

#9 – If we click on “Refers to,” it shows the data range,

#10 – We will add another product -“Product 6.”

#11 – Lastly, click on “Product Table” in the “Name Manager.” It also refers to the new data inserted.

Like this, we can use the OFFSET function to make dynamic tables.

Things to Remember

  • The PivotTables based on dynamic range automatically gets updated when refreshed.Using the OFFSET function in “Defined Name” can be seen from the “Name Manager” in the “Formula” tab.

This article is a guide to Dynamic Tables in Excel. Here, we discuss creating a dynamic table in Excel using TABLE and OFFSET functions and practical examples, and downloadable templates. You may learn more about Excel from the following articles: –

  • Excel Merge TablesPivot Table SortCreate a Dynamic Chart in ExcelCreate a Data Table in Excel