Dynamic Named Range Based on Cell Value in Excel

The basic idea of naming a range is the simple — we will use the Name Manager from the Formula tab. For each method, we are going to use the same dataset.

dataset for excel dynamic named range based on cell value


Method 1 – Create a Dynamic Named Range Based on Cell Value with the OFFSET Function

Steps:

  • Go to the Formulas tab on your ribbon.
  • Select Name Manager from the Defined Names group section.

name manager in the ribbon

  • The Name Manager box will appear.
  • Click on the New button in the top-left corner of the box.

creating new name for ranges

  • Insert a name in the Name field of the Edit Name.  We are choosing Device_Models as the name.
  • In the Refers to field, insert the following formula:

=OFFSET(OFFSET!$D$4,1,0,COUNTA(OFFSET!$D$5:$D$1000),1)

excel dynamic named range based on cell value using offset function

  • Click on OK and close the Name Manager.  The naming of the range is now complete.
  • Go to the spreadsheet and type out the following.

=Device_Models

  • Press Enter. You will find that the range will appear.

excel dynamic named range based on cell value for offset function output

  • If we add a value now, it will automatically update the output.

excel dynamic named range based on cell value for offset function test

Read More: OFFSET Function to Create & Use Dynamic Range in Excel


Method 2 – Combine OFFSET and MATCH Functions to Create a Dynamic Named Range

Steps:

  • Go to the Formulas ribbon on your tab.
  • Select Name Manager from the Defined Names group section.

  • When the Name Manager box pops up, select New in the top-left corner of the box.

  • Fill the Name field with the name you want.
  • Insert the following formula in the Refers to field beneath:

=OFFSET('OFFSET,MATCH(num)'!$E$4,1,0,MATCH(9.99999999999999E+307,'OFFSET,MATCH(num)'!$E$5:$E$1000),1)

excel dynamic named range based on cell value using offset and match for numbers

  • Click on OK and close the Name Manager.  The dynamic named range based on cell value is now complete.
  • Let’s go back to the Excel spreadsheet and insert the following formula.

=Device_Prices

  • Press Enter.

excel dynamic named range based on cell value using offset and match for numbers output

  • Insert a value under the column and you will see the output change accordingly.

excel dynamic named range based on cell value using offset and match for numbers test

Read More: Dynamic Range for Multiple Columns with Excel OFFSET


Method 3 – Generate a Named Range for Text Values by Joining OFFSET and MATCH Functions

Steps:

  • Go to the Formulas tab on your ribbon.
  • Select Name Manager from the Defined Names group section.

  • Click on the New button on the top-left of the dialog box.

  • Enter a name in the Name field in the following box, such as Device_Type.
  • Insert the following formula in the Refers to field to define the range.

=OFFSET('OFFSET,MATCH(text)'!$C$4,1,0,MATCH(REPT("z",255),'OFFSET,MATCH(text)'!$C$5:$C$1000),1)

excel dynamic named range based on cell value using offset and match for text

  • Click on OK and close the Name Manager.
  • To test it out, go back to the spreadsheet and use the following in a cell.

=Device_Type

  • Press Enter.

excel dynamic named range based on cell value using offset and match for text output

  • Enter a value under the column we are filtering from, and the output should change accordingly.

excel dynamic named range based on cell value using offset and match for text test


Method 4 – Apply the FILTER Function to Create a One-Dimensional Dynamic Named Range in Excel

Steps:

  • Go to the Formulas tab on your ribbon.
  • Select Name Manager from the Defined Names group section.

  • Click on the New button on the top-left of the Name Manager box that will pop up next.

  • Insert the name in the Name field of the following box.
  • Insert the formula in the Refers to box as the reference.

=FILTER(FILTER!$D:$D,((FILTER!$D:$D<>"")*(FILTER!$D:$D<>FILTER!$D$4)))

excel dynamic named range based on cell value using filter function

  • After clicking on OK here, close the Name Manager box.
  • To test the range out, type out or copy the name you gave to the range in a formula bar (after an equals sign).
  • Press Enter.

excel dynamic named range based on cell value using filter function output

  • Insert something under the column we are picking the reference from, and it will update the output.

excel dynamic named range based on cell value using filter function test


Method 5 – Create a Two-Dimensional Dynamic Named Range in Excel

Steps:

  • Go to the Formulas tab on your ribbon.
  • Select Name Manager from the Defined Name group section.

  • Click on New from the top-left of the Name Manager box that pops up.

  • Insert a name in the Name field for the range.
  • Insert the following formula in the Refers to field below.

='2D'!$B$5:INDIRECT("C"&COUNTA('2D'!$C:$C)-1+ROW('2D'!$C$4))

excel dynamic named range based on cell value for two dimensional arrays

  • Click on OK and close the Name Manager box.
  • To test if the formula works, go back to the spreadsheet and use the range’s name in a cell:

=Two_Dimensional_Array

  • After pressing Enter, you will find something like this.

excel dynamic named range based on cell value for two dimensional arrays output

  • Insert two values under the two columns we are taking for the two-dimensional arrays. The table should update the result.

excel dynamic named range based on cell value for two dimensional arrays test

Read More: Create Dynamic Sum Range Based on Cell Value in Excel


Insert the INDEX Function in Excel for Creating a Named Range Based on Cell Value

Steps:

  • Select the Formulas tab and go to Name Manager, which you can find from the Defined Names group.

  • Click on the New button at the top left of the popped-up box.

  • Insert a name in the Name box.
  • Insert the following formula in the Refers to field below that.

=INDEX(Sheet6!$B$5:$B$15,0,0)

excel dynamic named range based on cell value using index function

  • Click on OK.
  • Close the Name Manager box also.
  • Go back to the spreadsheet and insert the name of the range in a formula.

=Device_Brands

  • Press Enter on your keyboard.

excel dynamic named range based on cell value using index function output

Read More: How to Create Dynamic Range Using Excel INDEX Function


Use Name Cell in Excel to Generate Named Range

The simplest way to create a named range is to use the Name Cell feature of Excel. You can find it on the left side of the formula box on the spreadsheet.

Steps:

  • Select the range you want to name and manually edit this.

excel dynamic named range based on cell value using name cell

  • If you want to reference the range, just use the name you have given it.


Define Names from a Selected Range

Steps:

  • Select a range.

  • Select the Create from Selection feature from the Defined Names group of the Formulas tab.

define names from selected range

  • Select the option that matches your criteria. In this case, it is the Top row.

  • You can find the range through the name of the top row as shown in the following figure.

define names from selected range output


Download the Practice Workbook


Further Readings


<< Go Back to Dynamic Range | Named Range | Excel Formulas | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Md. Abdullah Al Murad
Md. Abdullah Al Murad

Md. Abdullah Al Murad is a computer engineer who loves exploring Excel and VBA programming. Programming, to him, is a time-saving tool for efficiently managing data, files, and internet tasks. He is proficient in C, C++, Python, JavaScript, HTML, SQL, MySQL, PostgreSQL, Microsoft Office, and VBA and goes beyond the basics. He holds a B.Sc. in Computer Science and Engineering from American International University-Bangladesh. He has transitioned into the role of a content developer. Beyond his work, find... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo