Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Defined Ranges in Excel: How to Create and Use Named Ranges

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Defined ranges, more commonly known as Named Ranges, allow you to assign a descriptive name to a cell or a group of cells. Instead of referencing a range by its coordinates (such as A1:B20), you can reference it by a meaningful name (such as "Sales_Data"). This achieves three primary goals: it makes complex formulas significantly easier to read, reduces the risk of errors when copying formulas across a sheet, and allows for faster navigation within large workbooks. To get started, you simply need a dataset in an Excel workbook and a basic understanding of how to select cells.

What You'll Need

  • Microsoft Excel (Desktop version for Windows or macOS).
  • An existing dataset or a set of cells you wish to label.
  • A plan for your naming convention to keep the workbook organized.

Step-by-Step

  1. Select the Target Range: Open your Excel workbook and highlight the cell or group of cells you want to define. You can click and drag your mouse, or hold the Ctrl key (Cmd on Mac) to select non-adjacent cells.
  2. Use the Name Box: Look at the Name Box, which is the small input field located to the left of the Formula Bar (above column A). Click inside this box. Note that labels and menu locations may differ slightly depending on your version of Excel or region.
  3. Enter the Range Name: Type a descriptive name for your selection. For example, if you have selected a column of prices, type "UnitPrices". Press Enter to commit the name. If you do not press Enter, the name will not be saved.
  4. Alternative Method via Formula Tab: If you prefer using the ribbon, go to the Formulas tab. In the Defined Names group, click on Define Name. A dialog box will appear.
  5. Configure the Define Name Dialog: In the Name field, type your chosen name. In the Scope dropdown, choose "Workbook" if you want the name to be accessible from any sheet, or select a specific sheet if the range should only be recognized locally. Verify the "Refers to" field shows the correct cell coordinates, then click OK.
  6. Apply the Named Range in a Formula: To use your defined range, start a formula as usual. For example, instead of typing =SUM(B2:B50), type =SUM(UnitPrices). Excel will provide an autocomplete suggestion as you begin typing the name.
  7. Manage Existing Names: To edit or delete a range, go to the Formulas tab and click Name Manager. This opens a window listing all defined ranges in the workbook. Select the name you wish to change, click Edit to update the cell references or the name, or click Delete to remove it entirely.

Common Mistakes

One of the most frequent errors is ignoring the strict naming rules enforced by Excel. You cannot start a named range with a number; it must begin with a letter, an underscore (_), or a backslash (\). Additionally, you cannot use spaces in a name. Many users try to name a range "Total Sales", which results in an error. Instead, use "Total_Sales" or "TotalSales".

Another common mistake is forgetting to press Enter after typing a name into the Name Box. If you click away from the box without hitting Enter, Excel discards the input, and the range remains undefined. This often leads users to believe the feature is broken when they try to use the name in a formula later.

Users also frequently confuse Named Ranges with Excel Tables. While both can be used for referencing, a Table (created via Ctrl+T) has dynamic headers and automatic expansion, whereas a standard Defined Range is static unless specifically configured as a dynamic formula. Using a static range for a list that grows every month will result in new data being ignored by your formulas.

Finally, overlapping ranges can cause confusion. While Excel allows you to define multiple names that cover the same cells, this can make the Name Manager cluttered and lead to errors during auditing. It is best to ensure each defined range has a unique purpose and a distinct boundary.

Tips

To speed up the process of creating many ranges at once, use the "Create from Selection" tool. First, type your desired headers in the row above or column to the left of your data. Select both the headers and the data, go to the Formulas tab, and click Create from Selection. Choose whether the names are in the Top row or Left column. Excel will automatically create named ranges based on those text labels, saving you from manual entry.

For better organization, use a prefix for your named ranges. For example, use "cfg_" for configuration constants (like cfg_TaxRate) and "data_" for actual datasets (like data_QuarterlyRevenue). This groups your names alphabetically in the Name Manager and the formula autocomplete list, making them much easier to find in complex workbooks.

If you have a dataset that changes in size, consider using a dynamic named range. Instead of a fixed reference like $A$1:$A$100, you can use the OFFSET and COUNTA functions in the "Refers to" field of the Name Manager. A formula like =OFFSET($A$1,0,0,COUNTA($A:$A),1) tells Excel to start at A1 and expand the range downward based on how many cells in column A contain data.

Use the F3 shortcut key while writing a formula. Once you have started a formula (e.g., =SUM(), pressing F3 will bring up a list of all your defined ranges. You can simply double-click the one you need, and Excel will insert the name into the formula for you.

Troubleshooting

If you receive a #NAME? error, it means Excel does not recognize the text you used in your formula. First, check for typos. Named ranges are not case-sensitive, but a single missing underscore or a misspelled word will break the link. Second, check the scope of the range. If the range was defined with a scope limited to "Sheet1", you cannot use that name while writing a formula on "Sheet2". To fix this, open the Name Manager and change the scope to "Workbook".

If the range is not updating when you add new rows of data, you are likely using a static range. Go to the Name Manager, select the range, and check the "Refers to" box. If it shows a fixed set of coordinates (e.g., $B$2:$B$10), it will not grow. You must either manually update the range in the Name Manager or convert your data into an official Excel Table (Ctrl+T), which creates a structured reference that expands automatically.

If you cannot find the Name Manager or the Name Box is missing, ensure you are not in "Cell Edit Mode". If your cursor is blinking inside a cell, many ribbon options are greyed out. Press Enter or Esc to exit the cell and try again. If the Name Box is still not visible, check if your formula bar is hidden. Go to the View tab and ensure the "Formula Bar" checkbox is checked.

Frequently Asked Questions

Can I use a named range across different worksheets?

Yes, as long as the scope of the named range is set to "Workbook" during creation. This allows any sheet within that specific file to reference the name.

Is there a limit to how many defined ranges I can have?

Excel does not have a strictly documented small limit, but having thousands of named ranges can slow down workbook performance and make the Name Manager difficult to navigate.

Can a named range refer to a formula instead of a cell?

Yes. In the "Refers to" box of the Name Manager, you can enter a formula. This is how dynamic ranges are created, allowing the range to resize itself based on the data present.

Do named ranges work in Excel Online?

Yes, you can use and reference named ranges in the web version of Excel, though the interface for managing them may differ slightly from the desktop application.

What happens to a named range if I delete the cells it refers to?

The name will still exist in the Name Manager, but the reference will change to #REF!. You will need to go into the Name Manager and either delete the name or reassign it to a new range of cells.