Using structured references with Excel tables

When you create an Excel table, Excel assigns a name to the table, and to each column header in the table. When you add formulas to an Excel table, those names can appear automatically as you enter the formula and select the cell references in the table instead of manually entering them. Here's an example of what Excel does:

Instead of using explicit cell references

Excel uses table and column names

That combination of table and column names is called a structured reference. The names in structured references adjust whenever you add or remove data from the table.

Structured references also appear when you create a formula outside of an Excel table that references table data. The references can make it easier to locate tables in a large workbook.

To include structured references in your formula, click the table cells you want to reference instead of typing their cell reference in the formula. Let’s use the following example data to enter a formula that automatically uses structured references to calculate the amount of a sales commission.

Sales Person

Sales Amount

% Commission

Commission Amount

  1. Copy the sample data in the table above, including the column headings, and paste it into cell A1 of a new Excel worksheet.
  2. To create the table, select any cell within the data range, and press Ctrl+T.
  3. Make sure the My table has headers box is checked, and click OK.
  4. In cell E2, type an equal sign (=), and click cell C2. In the formula bar, the structured reference [@[Sales Amount]] appears after the equal sign.
  5. Type an asterisk (*) directly after the closing bracket, and click cell D2. In the formula bar, the structured reference [@[% Commission]] appears after the asterisk.
  6. Press Enter. Excel automatically creates a calculated column and copies the formula down the entire column for you, adjusting it for each row.

What happens when I use explicit cell references?

If you enter explicit cell references in a calculated column, it can be harder to see what the formula is calculating.

  1. In your sample worksheet, click cell E2
  2. In the formula bar, enter =C2*D2 and press Enter.

Notice that while Excel copies your formula down the column, it doesn't use structured references. If, for example, you add a column between the existing columns C and D, you'd have to revise your formula.

How do I change a table name?

When you create an Excel table, Excel creates a default table name (Table1, Table2, and so on), but you can change the table name to make it more meaningful.

  1. Select any cell in the table to show the Table Tools >Design tab on the ribbon.
  2. Type the name you want in the Table Name box, and press Enter.

In our example data, we used the name DeptSales.

Use the following rules for table names:

Structured reference syntax rules

You can also enter or change structured references manually in the formula but to do that, it will help to understand structured reference syntax. Let’s go over the following formula example:

=SUM(DeptSales[[#Totals],[Sales Amount]],DeptSales[[#Data],[Commission Amount]])

This formula has the following structured reference components:

To create or edit structured references manually, use these syntax rules:

Use brackets around column headers with special characters If there are special characters, the entire column header needs to be enclosed in brackets, which means that double brackets are required in a column specifier. For example: =DeptSalesFYSummary[[Total $ Amount]]

Here’s the list of special characters that need extra brackets in the formula:

Here’s the list of special characters that need an escape character (') in the formula:

Use the space character to improve readability in a structured reference You can use space characters to improve the readability of a structured reference. For example: =DeptSales[ [Sales Person]:[Region] ] or =DeptSales[[#Headers], [#Data], [% Commission]]

It’s recommended to use one space:

Reference operators

For more flexibility in specifying ranges of cells, you can use the following reference operators to combine column specifiers.

This structured reference:

By using the:

Which is cell range:

All of the cells in two or more adjacent columns

: (colon) range operator

=DeptSales[Sales Amount],DeptSales[Commission Amount]

A combination of two or more columns

, (comma) union operator

=DeptSales[[Sales Person]:[Sales Amount]] DeptSales[[Region]:[% Commission]]

The intersection of two or more columns

(space) intersection operator

Special item specifiers

To refer to specific portions of a table, such as just the totals row, you can use any of the following special item specifiers in your structured references.

This special item specifier:

The entire table, including column headers, data, and totals (if any).

Just the data rows.

Just the header row.

Just the total row. If none exists, then it returns null.

Just the cells in the same row as the formula. These specifiers can’t be combined with any other special item specifiers. Use them to force implicit intersection behavior for the reference or to override implicit intersection behavior and refer to single values from a column.

Excel automatically changes #This Row specifiers to the shorter @ specifier in tables that have more than one row of data. But if your table has only one row, Excel doesn’t replace the #This Row specifier, which may cause unexpected calculation results when you add more rows. To avoid calculation problems, make sure you enter multiple rows in your table before you enter any structured reference formulas.

Qualifying structured references in calculated columns

When you create a calculated column, you often use a structured reference to create the formula. This structured reference can be unqualified or fully qualified. For example, to create the calculated column, called Commission Amount, that calculates the amount of commission in dollars, you can use the following formulas:

Type of structured reference

=[Sales Amount]*[% Commission]

Multiplies the corresponding values from the current row.

=DeptSales[Sales Amount]*DeptSales[% Commission]

Multiples the corresponding values for each row for both columns.

The general rule to follow is this: If you’re using structured references within a table, such as when you create a calculated column, you can use an unqualified structured reference, but if you use the structured reference outside of the table, you need to use a fully qualified structured reference.

Examples of using structured references

Here are some ways to use structured references.

This structured reference:

Which is cell range:

All the cells in the Sales Amount column.

The header of the % Commission column.

The total of the Region column. If there is no Totals row, then it returns null.

=DeptSales[[#All],[Sales Amount]:[% Commission]]

All the cells in Sales Amount and % Commission.

=DeptSales[[#Data],[% Commission]:[Commission Amount]]

Just the data of the % Commission and Commission Amount columns.

Just the headers of the columns between Region and Commission Amount.

=DeptSales[[#Totals],[Sales Amount]:[Commission Amount]]

The totals of the Sales Amount through Commission Amount columns. If there is no Totals row, then it returns null.

Just the header and the data of % Commission.

=DeptSales[[#This Row], [Commission Amount]]

The cell at the intersection of the current row and the Commission Amount column. If used in the same row as a header or total row, this will return a #VALUE! error.

If you type the longer form of this structured reference (#This Row) in a table with multiple rows of data, Excel automatically replaces it with the shorter form (@). They both work the same.

E5 (if the current row is 5)

Strategies for working with structured references

Consider the following when you work with structured references.

Note: Copying a structured reference and doing a fill of a structured reference are not the same thing. When you copy, all the structured references remain the same, while when you fill a formula, fully qualified structured references adjust the column specifiers like a series as summarized in the following table.

If the fill direction is:

And while filling, you press: