Have Questions? 
help@excelvbaisfun.com
Excel Ninja Pro
All Access

August 30, 2022

How To Improve Your Excel Formulas With Named Ranges

Avoid typing the same cell address(es) multiple times in a formula. Use familiar nicknames instead.

What is a named range?

Named ranges are a great way to make your formulas more readable and easier to reference. They're also great for using common values without having to type them every time. Named ranges make it easy to use values that you commonly use, and they're a great way to improve the clarity of your formulas.

How to create a named range in Excel?

Named ranges can be a life-saver when it comes to Excel formulas. By assigning a name to a range of cells, you can easily reference the range in future calculations. To create a named range in Excel:

  • Select the cells you need
  • Click in the Name Box to the left of the formula bar
  • Give the range a nickname by entering a name in the Name Box - this will become the name of the range.
  • Hit the Enter key to confirm the name.

You can then use the named range in your formulas without having to remember the cell references. You can reference the range throughout your formulas by simply referring to the nickname. For example, if you have a column of data called 'Sales,' and you want to calculate the total sales for each month, you can use the named range 'Month_Sales' in your formula. This will ensure that the range is always updated and the formula is error-free.

Check out this video for some instant tips and use cases!

Examples of how to use a named range in a formula

Named ranges can make your life in Excel a lot easier. For example, you can use them in lookup functions, such as Index/Match, VLookup or the new XLookup functions. To use a named range in a formula, just insert the name instead of the cell reference (instead of A1:C4, use something like myNamedRng). You can also use named ranges to get the SUM of all the cells in a named range, such as =SUM(employeeBenefits). Named ranges make your formulas more readable and easier to follow. So, if you're struggling to get the formula right, try using a named range and see how it makes the task a lot simpler.

Why should you use named ranges in your Excel formulas?

Formulas in Excel are essential for getting the most out of your data. But while they're useful on their own, named ranges can make them even more powerful. Named ranges make your formulas easier to read and understand. They also help you avoid errors, since you'll know exactly where each reference is located in the file.

VBA and Macros are also a lot easier to use when you use named ranges because even if the cell area expands, the name remains the same, but cell addresses may change.

Consider this scenario. You have cells C6:D10 as a small lookup table you need. In VBA, you have to hard code these as text, such as Range("C6:D10"). When you add some more rows and your lookup range is now C6:D14, the text in your macro still reads Range("C6:D10"). If you don't use a named range in your macro, you may not be accessing all of your lookup table.

If you had given the table a named range of "companies", then it would always look the same in VBA and function properly, regardless of row and column additions. It would look like this: Range("companies").

In short, named ranges are a valuable addition to your Excel toolkit, and should be used in a lot of your formulas. Especially ones that refer to other sheets (that's a lot of wasted characters).

Get Excel Ninja Pro

Frequently Asked Questions

What is the difference between a named range and a regular range?

Named ranges are customized and memorable, whereas Excel default cell references are not memorable. Named ranges can be very helpful when you need to reference a particular cell multiple times in the same worksheet.

For example, you might name the entire range for Accounts Receivable as "arTable" and use it to enter the sum of all the sales revenues from individual accounts receivable lines in the worksheet. This way, you'll never have to remember the cell reference for Accounts Receivable again.

What are some best practices for naming ranges in Excel?

There are a few best practices for naming ranges in Excel. First and foremost, make sure your names are easy to remember and spelled correctly. Avoid symbols and spacebars (you can use underscore though) and try to use words only. If you're dealing with multiple named ranges, try using a pattern or a naming convention to avoid confusion later on. For example, if you have a column called "Accounts Receivable" and another column called "Inventory", you might name the first column "Receivables" and the second column "Inventories". This way, when you want to reference the value in the "Inventory" column, you would simply type "Inventory". Finally, do not name a range using a reserved name, such as A12. Instead, use a unique or meaningful word or phrase to help you remember what these cells are about.

What are some of the limitations of Named Ranges in Excel?

Named ranges in Excel are great for referencing values, but they have a few limitations. You shouldn't use spaces when creating a named range. Instead, try underscore (_) or period (.), such as "acc_receivable" or "acc.receivable". If you want to rename or delete a range in Excel, it's best to use the Names Manager from the Formulas tab instead of just typing the range name. Typing in the name of the range in the Names Box only will select the range.

Can named ranges help me to avoid typos when entering data into my formulas?

Yes, named ranges can definitely help you avoid typos when entering data into your formulas. They can also be helpful when graphing data - by assigning specific names to different axes labels, it'll be much easier for you to keep track of where each point falls on the graph.

You can even change the data range for a PivotTable so that it dynamically refers to a named range. This way, when you refresh the PivotTable, it will always have current and accurate data.

Additionally, named ranges can be helpful when entering text into your formulas - this will make it easy for you to type in long lists of data easily. That way, you'll know what data is being entered into the formula and it will be easier for you to track down errors.

How would I go about deleting a named range from my workbook?

To delete a name from your workbook, first open the Names Manager. Next, select the name you want to delete. Then, choose "Edit" or "Delete" to modify it.

What are some situations where named ranges can be useful?

Named ranges can be really helpful if you're looking to perform simple statistical analysis, indexing data, or finding specific values in a huge array of entries. Some common situations where named ranges would come in handy include: indexing data, finding the lowest or highest value in a data set, and performing simple statistical analysis. Named ranges can also be really helpful when working with data sets that are too large or complex to enter manually. Instead of trying to remember the exact column and row numbers for each value, you can simply name the range and the excel program will automatically lookup the corresponding value for you.

Can I save time by using named ranges in my macros instead of hard-coding values throughout my formulas?

Yes, you can save time by using named ranges in your macros. By providing a name to the range, you don't have to remember the exact name of the range each time. This makes the formula easier to read and saves you time in remembering how to reference values within the formula. Additionally, named ranges make it easier for you to reference values quickly and accurately.

Named range shortcuts

There are some neat keyboard shortcuts you can use with named ranges, such as:

  • Press Alt+I+N+D to open the Names Manager
  • Press Ctrl+Shift+F3 to automatically generate names from selected cells (see video)

Can I use multiple names for the same range in my spreadsheet cells?

Yes, you can use multiple names for the same range in your spreadsheet cells. To use multiple names for a range, simply select the range and type a different name in the Names Box and press Enter.

What is the Names Manager in Excel?

The Names Manager in Excel is an invaluable tool for anyone who works with formulas and data. It allows you to easily manage the names of ranges and cells, making it easier to see what cell nicknames are present.

What's a Keyboard Shortcut for the Names Manager?

To use the Names Manager, press Alt+I+N+D on your keyboard. Once you've found the right name, simply highlight it and hit Enter to insert it into your formulas. This will open the Names Manager where you can search for a name or type in a new one.

Can you add a named range using VBA and macros?

Yes! Here's a line of code that will add a named range with VBA code in Excel:

ThisWorkbook.Names.Add Name:="taxTable", RefersTo:=Sheet2.Range("A2:D21")

Can you hide a named range and still use it?

Yes, you can hide a named range in Excel and still use it. This is done when creating a named range using VBA code. Similar to how we added a named range using VBA above, we now will add the Visible property as being false, which makes this name invisible to the Names Manager, Define Name, Paste Name or Goto dialog box. You can still use it in formulas or refer to it in VBA. It looks something like this:

ThisWorkbook.Names.Add Name:="taxTable", RefersTo:=Sheet2.Range("A2:D21"), Visible:=False

Conclusion

Named ranges are an important tool that can help you improve the efficiency of your Excel formulas. By specifying the name of the range in the formula, you can easily reference the value of the range without having to use the formula syntax every time. Additionally, named ranges can be used to store values for later use in the formula, making your formulas more efficient and error-free. In summary, named ranges are a valuable addition to your Excel arsenal that can help you improve the accuracy and clarity of your formulas. Don't wait any longer - start using named ranges in your formulas today!

Excel VBA Is Fun

We believe Excel is one of the most versatile programs out there - and learning to program and automate it makes you very valuable!

You can prevent wasted time and errors, speed up tasks and become indispensable to your organization. 

See how our trainees have gotten raises, promotions and bonuses using their Excel Automation skills while building real problem-solving programs in Excel!
LEARN MORE
Copyright © 2024 ExcelVbaIsFun
X

Forgot Password?

Join Us

0
    0
    Your Cart
    Your cart is emptyReturn to Shop
    linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram