Creating a Named Range in Excel
There are three ways to define a name in Excel:-
-
By Typing a name in the Name Box
We select a cell or a range of cells that we want to name, then type a name in the Name Box, and after that, press Enter.
-
Creating a name by using the Define Name Option
We select a cell or a range of cells. Then on the Formulas tab under Define Names Group, we click the Define Name button. Then a New Name dialog box pops up where we need to specify three things.
We need to type the range name in the Name Box. Then we set the name scope in the Scope Dropdown. At last, we check the reference and correct it if needed in the Refers to the box. In the end, we click OK to save all the changes and close the dialog box.
-
Making a Named Range using Excel Name Manager
We go to the Formulas tab > Defined Names group, click Name Manager. Or, press Ctrl + F3. Then in the top left-hand corner of the Name Manager dialog window, click the New button. This will then open the New Name dialog box where you configure a name as done previously.
Creating an Excel Name for a constant
Microsoft allows us to define a name without a cell reference that will work as a named constant. Thus, we use the Excel Define Name feature or Name Manager to create such a name, as explained above.
How to name columns in Excel
- Select the entire table (including the column and row headers).
- Go to the Formulas tab > Define Names group, and click the Create from Selection button. Or, press the keyboard shortcut Ctrl + Shift + F3.
- Either way, the Create Names from Selection dialogue box will open. You select the column or row with headers, or both, and click OK.
Excel Naming Rules
- An Excel name should be under 255 characters long.
- The names should not contain spaces and most of the punctuation marks.
- A name should begin with a letter, underscore (_), or backslash (\).
- These names are case-sensitive.
Excel Name Scope
There are two types of Excel Name Scope:-
- Specific Worksheet - the local worksheet level
- Workbook - the global workbook level
How to Edit Named Range in Excel
First, we open the Name Manager, then select the name and click the Edit button. This will open the Edit Name dialog box where we can change the name and reference. We cannot change the scope of the name.
We do not need to open the Edit Name dialog box to edit a name reference. We need to select the name of interest in the Excel Name Manager, type a new reference directly in the Refers to box, or click the button at the right and select the desired range on the sheet. After that, we click the Close button. Then Excel will ask if we want to save the changes, and we click Yes.
How to filter names in Excel
The filters available are:-
- Names scoped to Worksheet or workbook
- Names with or without errors
- Defined names or table names
How to delete Named Range in Excel
Delete a named range - select it in the Name Manager and click the Delete button at the top.
Delete several names - click the first name, then press the Ctrl key and hold it while clicking other names we want to remove. Then click the Delete button, and all selected names will be deleted.
Delete all defined names in a workbook - select the first name in the list, then press and hold the Shift key, and then click the last name. Release the Shift key and click Delete.
Benefits of using names in Excel
- Excel names help in making formulas easier to read.
- It makes formulas easier to re-use.
- It allows us to create expandable formulas.
- It helps to simplify navigation.
- It also allows us to create dynamic dropdown lists.
FAQs
-
What is the shortcut to open the Excel Name Manager?
Ctrl+F3
-
What is the shortcut to getting a list of all Excel names in a workbook?
F3
-
What is the shortcut to creating named ranges from the selection?
Ctrl+Shift+F3
-
What is #REF! error?
If we delete all cells that make up an Excel named range, the names become invalid and display a #REF! error in the Name Manager.
-
What is #NAME? error?
This error comes up when a formula refers to a non-existing name.
Key Takeaways
In this article, we have extensively discussed the Named Ranges of Excel. We hope that this blog has helped you enhance your knowledge regarding Named Ranges.
If you want to learn more, check out our articles on Days and DATEDIF Function, HLOOKUP Function, Today and Now Function, Dynamic Array Functions.
Refer to our guided paths on Coding Ninjas Studio to learn more about DSA, Competitive Programming, JavaScript, System Design, etc.
Enrol in our courses and refer to the mock test and problems available.
Take a look at the interview experiences and interview bundle for placement preparations.
Do upvote our blog to help other ninjas grow.
Happy Coding!