Excel dynamic named range: how to create and use (2024)

In this tutorial, you will learn how to create a dynamic named range in Excel and how to use it in formulas to have new data included in calculations automatically.

In last week's tutorial, we looked at different ways to define a static named range in Excel. A static name always refers to the same cells, meaning you would have to update the range reference manually whenever you add new or remove existing data.

If you are working with a continuously changing data set, you may want to make your named range dynamic so that it automatically expands to accommodate newly added entries or contracts to exclude removed data. Further on in this tutorial, you will find detailed step-by-step guidance on how to do this.

How to create a dynamic named range in Excel

For starters, let's build a dynamic named range consisting of a single column and a variable number of rows. To have it done, perform these steps:

  1. On the Formula tab, in the Defined Names group, click Define Name. Or, press Ctrl + F3 to open the Excel Name Manger, and click the New… button.
  2. Either way, the New Name dialogue box will open, where you specify the following details:
    • In the Name box, type the name for your dynamic range.
    • In the Scope dropdown, set the name's scope. Workbook (default) is recommended in most cases.
    • In the Refers to box, enter either OFFSET COUNTA or INDEX COUNTA formula.
  3. Click OK. Done!

In the following screenshot, we define a dynamic named range items that accommodates all cells with data in column A, except for the header row:
Excel dynamic named range: how to create and use (1)

OFFSET formula to define an Excel dynamic named range

The generic formula to make a dynamic named range in Excel is as follows:

OFFSET(first_cell, 0, 0, COUNTA(column), 1)

Where:

  • first_cell - the first item to be included in the named range, for example $A$2.
  • column - an absolute reference to the column like $A:$A.

At the core of this formula, you use the COUNTA function to get the number of non-blank cells in the column of interest. That number goes directly to the height argument of the OFFSET(reference, rows, cols, [height], [width]) function telling it how many rows to return.

Beyond that, it's an ordinary Offset formula, where:

  • reference is the starting point from which you base the offset (first_cell).
  • rows and cols are both 0, since there are no columns or rows to offset.
  • width is equal to 1 column.

For example, to build a dynamic named range for column A in Sheet3, beginning in cell A2, we use this formula:

=OFFSET(Sheet3!$A$2, 0, 0, COUNTA(Sheet3!$A:$A), 1)

Note. If you are defining a dynamic range in the current worksheet, you do not need to include the sheet name in the references, Excel will do it for you automatically. If you are building a range for some other sheet, prefix the cell or range reference with the sheet's name followed by the exclamation point (like in the formula example above).

INDEX formula to make a dynamic named range in Excel

Another way to create an Excel dynamic range is using COUNTA in combination with the INDEX function.

first_cell:INDEX(column,COUNTA(column))

This formula consists of two parts:

  • On the left side of the range operator (:), you put the hard-coded starting reference like $A$2.
  • On the right side, you use the INDEX(array, row_num, [column_num]) function to figure out the ending reference. Here, you supply the entire column A for the array and use COUNTA to get the row number (i.e. the number of non-entry cells in column A).

For our sample dataset (please see the screenshot above), the formula goes as follows:

=$A$2:INDEX($A:$A, COUNTA($A:$A))

Since there are 5 non-blank cells in column A, including a column header, COUNTA returns 5. Consequently, INDEX returns $A$5, which is the last used cell in column A (usually an Index formula returns a value, but the reference operator forces it to return a reference). And because we have set $A$2 as the starting point, the final result of the formula is the range $A$2:$A$5.

To test the newly created dynamic range, you can have COUNTA fetch the items count:

=COUNTA(Items)
Excel dynamic named range: how to create and use (2)

If all done properly, the result of the formula will change once you add or remove items to/from the list:
Excel dynamic named range: how to create and use (3)

Note. The two formulas discussed above produce the same result, however there is a difference in performance you should be aware of. OFFSET is a volatile function that recalculates with every change to a sheet. On powerful modern machines and reasonably sized data sets, this should not be a problem. On low-capacity machines and large data sets, this may slow down your Excel. In that case, you'd better use the INDEX formula to create a dynamic named range.

How to make two-dimensional dynamic range in Excel

To build a two-dimensional named range, where not only the number of rows but also the number of columns is dynamic, use the following modification of the INDEX COUNTA formula:

first_cell:INDEX($1:$1048576, COUNTA(first_column), COUNTA(first_row)))

In this formula, you have two COUNTA functions to get the last non-empty row and last non-empty column (row_num and column_num arguments of the INDEX function, respectively). In the array argument, you feed the entire worksheet (1048576 rows in Excel 2016 - 2007; 65535 rows in Excel 2003 and lower).

And now, let's define one more dynamic range for our data set: the range named sales that includes sales figures for 3 months (Jan to Mar) and adjusts automatically as you add new items (rows) or months (columns) to the table.

With the sales data beginning in column B, row 2, the formula takes the following shape:

=$B$2:INDEX($1:$1048576,COUNTA($B:$B),COUNTA($2:$2))
Excel dynamic named range: how to create and use (4)

To make sure your dynamic range works as it is supposed to, enter the following formulas somewhere on the sheet:

=SUM(sales)

=SUM(B2:D5)

As you can see in the screenshot bellow, both formulas return the same total. The difference reveals itself in the moment you add new entries to the table: the first formula (with the dynamic named range) will update automatically, whereas the second one will have to be updated manually with each change. That makes a huge difference, uh?
Excel dynamic named range: how to create and use (5)

How to use dynamic named ranges in Excel formulas

In the previous sections of this tutorial, you have already seen a couple of simple formulas that use dynamic ranges. Now, let's try to come up with something more meaningful that shows the real value of an Excel dynamic named range.

For this example, we are going to take the classic INDEX MATCH formula that performs Vlookup in Excel:

INDEX (return_range, MATCH (lookup_value, lookup_range, 0))

Excel dynamic named range: how to create and use (6)

…and see how we can make the formula even more powerful with the use of dynamic named ranges.

As shown in the screenshot above, we are attempting to build a dashboard, where the user enters an item name in H1 and gets the total sales for that item in H2. Our sample table created for demonstration purposes contains only 4 items, but in your real-life sheets there can be hundreds and even thousands of rows. Furthermore, new items can be added on a daily basis, so using references is not an option, because you'd have to update the formula over and over again. I'm too lazy for that! :)

To force the formula to expand automatically, we are going to define 3 names: 2 dynamic ranges, and 1 static named cell:

Lookup_range: =$A$2:INDEX($A:$A, COUNTA($A:$A))

Return_range: =$E$2:INDEX($E:$E, COUNTA($E:$E))

Lookup_value: =$H$1

Note. Excel will add the name of the current sheet to all references, so before creating the names be sure to open the sheet with your source data.

Now, start typing the formula in H1. When it comes to the first argument, type a few characters of the name you want to use, and Excel will show all available matching names. Double-click the appropriate name, and Excel will insert it in the formula right away:
Excel dynamic named range: how to create and use (7)

The completed formula looks as follows:

=INDEX(Return_range, MATCH(Lookup_value, Lookup_range, 0))

And works perfectly!
Excel dynamic named range: how to create and use (8)

As soon as you add new records to the table, they will be included in your calculations at once, without you having to make a single change to the formula! And if you ever need to port the formula to another Excel file, simply create the same names in the destination workbook, copy/paste the formula, and get it working immediately.

Tip. Apart from making formulas more durable, dynamic ranges come in handy for creating dynamic dropdown lists.

This is how you create and use dynamic named ranges in Excel. To have a closer look the formulas discussed in this tutorial, you are welcome to download our sample Excel Dynamic Named Range Workbook. I thank you for reading and hope to see you on our blog next week!

You may also be interested in

  • Excel names and named ranges
  • Microsoft Excel formulas with examples
Excel dynamic named range: how to create and use (2024)

FAQs

Excel dynamic named range: how to create and use? ›

For this, select the complete data to be included in Dynamic Table and then click on the Pivot Table option under the Insert menu tab or press the shortcut ALT + N + V simultaneously to apply it. Then drag and drop the required fields into the relevant section to create a Dynamic Table.

How do you create and use named ranges in Excel? ›

Create a named range from selected cells in a worksheet
  1. Select the range you want to name, including the row or column labels.
  2. Click Formulas > Create from Selection.
  3. In the Create Names from Selection dialog box, select the checkbox (es) depending on the location of your row/column header. ...
  4. Click OK.

How do I create a dynamic table range in Excel? ›

For this, select the complete data to be included in Dynamic Table and then click on the Pivot Table option under the Insert menu tab or press the shortcut ALT + N + V simultaneously to apply it. Then drag and drop the required fields into the relevant section to create a Dynamic Table.

Which two functions we can use to create dynamic range names in Excel? ›

If Excel selects an area of your worksheet, the formula returns a reference. You'll typically use two functions to return references for dynamic range names: OFFSET and INDEX.

How do I Create a custom range name in Excel? ›

Select the range you want to name, including the row or column labels. Select Formulas > Create from Selection. In the Create Names from Selection dialog box, designate the location that contains the labels by selecting the Top row,Left column, Bottom row, or Right column check box. Select OK.

How do I create a dynamic function in Excel? ›

How do you do a dynamic text formula in Excel?
  1. Select the text box then navigate to the Formulas tab.
  2. Type = and the cell address of the cell you want to link. Press Enter, and dynamic text in Excel is done.
Apr 19, 2024

What is unique with dynamic range in Excel? ›

The UNIQUE function will return an array, which will spill if it's the final result of a formula. This means that Excel will dynamically create the appropriate sized array range when you press ENTER.

How do I create a dynamic row in Excel? ›

An alternate method of creating dynamic numbered lists in an Excel Table is to use the ROW function. The ROW function returns the row number in which the function resides. If the function is used on row 3, the number 3 is returned. Below is an example of using the ROW function in a table.

How do I use a named range from another workbook? ›

Importing a Named Range from Excel
  1. From the menu select File | Open then navigate to your required spreadsheet.
  2. Select the spreadsheet file and click Open.
  3. Any named ranges are identified by the prefix R:. ...
  4. Select your open workbook or select New Book to create a new one, then click Finish to add the named range to it.
Feb 27, 2019

What is the advantage of using named ranges in Excel? ›

Named ranges have many advantages. They can help make formulas easier to understand, especially for those who are not familiar with Excel. Additionally, if the range of cells changes, you only need to update the named range once, and all formulas that reference it will automatically update.

How do you copy an Excel sheet with named ranges? ›

You can set the scope of the source named range to just the sheet, then copy the sheet. The named ranges will be copied as well. To change the scope, use the Name Manager in Data section of the ribbon, or push Ctrl + F3 . Select the Range and click edit.

References

Top Articles
Strange World Showtimes Near Atlas Cinemas Great Lakes Stadium 16
Pisces Daily Horoscope | Cafe Astrology .com
Vegas X Vip.org
Krua Thai In Ravenna
Get maximum control with JCB LiveLink | JCB.com
What Is Carrier Default App? Everything You Need To Know - Mobile Soon
Leon Vs Chisec Figs
Joe Jonas Lpsg
Lowes Maytag Pet Pro Commercial Actress
manhattan cars & trucks - by owner - craigslist
How Nora Fatehi Became A Dancing Sensation In Bollywood 
John W Creasy Died December 16 2003
Walgreens Boots Alliance, Inc.: Konsensus der Analysten und Kursziel | A12HJF | US9314271084 | MarketScreener
Martimelons
Cheap Motorcycles For Sale Under 1000 Craigslist Near Me
Shae Cornette Bikini
My Big Fat Greek Wedding 3 Showtimes Near Regal Ukiah
Famous Sl Couples Birthday Celebration Leaks
My Eschedule Greatpeople Me
Walmart Com Careers Jobs
Norte Asesores Nanda
Dawat Restaurant Novi
Open jazz : podcast et émission en replay | France Musique
Kup telewizor LG OLED lub QNED i zgarnij do... 3000 zł zwrotu na konto! Fantastyczna promocja
Greenville Daily Advocate Greenville Ohio
Aleksandr: Name Meaning, Origin, History, And Popularity
Auto-Mataru
All Added and Removed Players in NBA 2K25 (Help Us Catch 'Em All)
Ecem Hotoglu
Harris Teeter Weekly Ad Williamsburg Va
Maine Marine Forecast Gyx
Wall Tapestry At Walmart
Ret Paladin Phase 2 Bis Wotlk
Vip Market Vetsource
2024-25 ITH Season Preview: USC Trojans
Sign in to Office - Microsoft Support
Cargurus Honda Accord
Don Wallence Auto Sales Reviews
Horoscope Daily Yahoo
Brublackvip
When Is The Next Va Millionaire Raffle 2023
Paul Mauro Bio
Stellaris Resolution
Shirley Arica Unlock
Presentato il Brugal Maestro Reserva in Italia: l’eccellenza del rum dominicano
Craigslist Covington Georgia
Ap Bio Unit 2 Progress Check Mcq
Ticketmaster Lion King Chicago
Job Training and Education Scholarships | Workforce Solutions | Greater Houston | Texas
Jeep Forum Cj
Where Is Katie Standon Now 2021
Latest Posts
Article information

Author: Van Hayes

Last Updated:

Views: 5688

Rating: 4.6 / 5 (46 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Van Hayes

Birthday: 1994-06-07

Address: 2004 Kling Rapid, New Destiny, MT 64658-2367

Phone: +512425013758

Job: National Farming Director

Hobby: Reading, Polo, Genealogy, amateur radio, Scouting, Stand-up comedy, Cryptography

Introduction: My name is Van Hayes, I am a thankful, friendly, smiling, calm, powerful, fine, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.