Naming Ranges and Other Objects
Naming Ranges and Other Objects
In Excel, groups of cells are called ranges. The cell groups are either contiguous or non-
contiguous. You can name (define) individual cells or ranges, change the size of ranges
after you define them, and use named cells or ranges in formulas. You also can assign a
name to data ranges that are formatted as a table in Excel. The Name Box and the Name
Manager help you keep track of named ranges and their cell addresses. You can also use
the Paste Names command to create a list of named ranges and their addresses in a
worksheet.
Naming Cells and Data Ranges
In Excel, you can assign names to cells, cell ranges, and tables to make it easier to
understand the meaning of formulas that reference these items. For example, if you have
a series of sales figures in a column, instead of referring to them as the range E3:E14, you
can name them SalesQ4. Any time you use the name SalesQ4 in a formula, Excel would
then use the values in those cells.
1 de 6 14/04/2021, 14:32
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...
box. You can change the name if you like. For this exercise, leave the default name.
Figure 3-2: Using the New Name dialog box to name a range
8. Click the Scope drop-down arrow. Your options are Workbook, Expenses, and
Summary. The last two entries correspond to individual sheets in the workbook.
Close the drop-down list, leaving Workbook selected.
9. In the Comment text box, type Total monthly expenses.
The Refers to text box displays the range you selected. Notice that the sheet name is
also included automatically.
10. Click OK. The name Monthly_Totals is saved for the range B17:M17.
11. A third way to name a range is to use the Create Names from Selection dialog box.
Select N3:N15. This selection includes the column heading label.
12. On the Formulas tab, in the Defined Names group, click Create from Selection. The
Create Names from Selection dialog box appears.
13. Excel determines that you want to use the column heading label as the range name.
Click OK. The range is saved with the name Total.
14. You can assign names to individual cells as well as cell ranges. Select cell N17. To the
left of the formula bar, click the Name Box, type GrandTotal, and then press Enter.
15. Open the Name Box drop-down list. You have four named ranges from which to
select. Press Esc to close the list.
16. SAVE the workbook.
PAUSE. LEAVE the workbook open to use in the next exercise.
Naming ranges or an individual cell according to the data they contain is a time-saving
technique, even though it might not seem so when you work with limited data files in
practice exercises. However, naming a range in a large or complex worksheet enables you
to go to the location quickly, similar to a bookmark. After creating named ranges, you can
select a name in the Name Box drop-down list to select the named range on the
worksheet.
Rules and guidelines for naming ranges include the following:
• Range names can be up to 255 characters in length.
• Range names may begin with a letter, the underscore character (_), or a backslash
(\). The rest of the name may include letters, numbers, periods, and underscore
characters, but not a backslash.
• Range names may not consist solely of the letters “C”, “c”, “R”, or “r”, which are used
2 de 6 14/04/2021, 14:32
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...
Take Note You can use the same name for equivalent ranges in other worksheets
within a workbook. Include the name of the worksheet in brackets before the range name
to identify which worksheet you’re referring to.
Component Meaning
TableName An arbitrary name you give to a table, in place of its reference as a range.
You can have more than one table on a worksheet, although it might not
always be convenient.
Examples: Customers, Back Orders, Comics Issues
[FieldName] The field name from the header row of the table. The name refers to the
set of all cells that comprise the named column in the table. You do not
need to specify the start and end cell. The field name is always denoted
with [square brackets].
Examples: [Last Name], [Sale Price], [Issue Date]
Excel recognizes four constants that refer to the same general area of a table, which you
may use here when applicable to replace the field name:
Constant Meaning
3 de 6 14/04/2021, 14:32
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...
#Header The set of all cells in the first row in the table
s
#Totals The set of all cells where totals appear, usually the rightmost column of the
table where a SUM function is used
After you begin typing the table or field name, Excel displays a list of names you can add
to the formula (including named ranges). Instead of typing the rest of the name, you can
use the arrow keys on the keyboard to navigate this menu until the name you want (the
table name) is highlighted and then press Tab. The entire name is entered into the
formula, saving you a few seconds of time.
With the table name entered, when it’s time to refer to a field name in the table, you can
start with the left square bracket ( [ ). Excel displays a list of all the field names already in
the table. You use the arrow keys to highlight the one you’re looking for and then press
Tab. Then type the right square bracket ( ] ) to complete the reference and press Enter.
Similarly, whenever you want to use one of the four constants (#All, #Data, #Headers, or
#Totals), you just start with the pound sign #. Excel displays the list and then you
highlight the one you want and press Tab.
Take Note When referring to a field name by name in a formula that’s used inside the
same table as the field name, you can omit the table name. For example, the reference
Customers[City] can be substituted with just City when the reference is inside the
Customers table.
4 de 6 14/04/2021, 14:32
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...
name in structured references in Excel table formulas, as described in the text that
precedes this exercise.
5 de 6 14/04/2021, 14:32
OneNote https://euc-onenote.officeapps.live.com/o/onenoteframe.aspx?ui=pt-PT&...
Figure 3-6: Use the Paste Names command to display a list of defined names in
a worksheet
11. SAVE the 03 Expenses Solution.xlsx workbook and then CLOSE the workbook.
PAUSE. LEAVE Excel open for the next exercise.
6 de 6 14/04/2021, 14:32