Excel Table Formula Syntax: A Practical Guide
In this article
Excel table formulas use structured references instead of cell addresses, so a formula like =SUM(Sales[Amount]) automatically covers every row in the Amount column, even as the table grows. To use them, first format your data as a table (select it and press Ctrl+T on Windows or Cmd+T on Mac, or use Insert > Table), give the table and its columns clear names, then write formulas that refer to those names. The rest of this guide explains the syntax, the common variations, and how to fix the errors that trip people up.
What You'll Need
- Excel 2010 or later on Windows or Mac, or Excel for the web. Structured references work in all of them; the exact menu labels can differ slightly by version, device or region.
- A range of data with a single header row and no blank rows or columns inside it.
- Basic familiarity with ordinary formulas such as
=SUM(A2:A10).
Step-by-Step
- Convert the range to a table. Select any cell in your data and press Ctrl+T (Windows) or Cmd+T (Mac), or go to Insert > Table. Confirm that the range is correct and that “My table has headers” is ticked, then click OK. On Excel for the web the same Insert > Table command is available on the Home tab.
- Give the table a meaningful name. Click any cell in the table, open the Table Design tab (called Table on some Mac versions), and edit the Table Name box on the left. Use a single word with no spaces, such as
SalesorInventory. Press Enter. A good name makes every formula shorter and easier to read. - Check the column headers. Structured references use the header text exactly, so keep headers short and unique. Avoid spaces where you can; if a header contains a space or a special character, you must wrap it in square brackets and apostrophes, as shown later.
- Write your first structured formula. Click an empty cell outside the table and type
=SUM(Sales[Amount]). The pattern isTableName[ColumnName]. Press Enter. The result is the total of the Amount column for every data row. Notice that the header row is excluded automatically. - Use the @ symbol for the current row. Inside a table, a formula such as
=[@Price]*[@Quantity]multiplies the Price and Quantity values on the same row. Excel adds the @ automatically when you click cells while building a formula inside a table. If you type it manually, keep the @ before the column name. - Reference the whole table or the totals row.
Sales[#All]includes headers and totals;Sales[#Data]is data rows only;Sales[#Headers]andSales[#Totals]target those rows. To total a column,=SUM(Sales[Amount])is usually enough. - Handle headers with spaces or punctuation. If a column is named
Unit Price, writeSales[Unit Price]. If it contains a bracket, apostrophe or similar character, use the escape formSales['#Of Items]or rename the header to something simpler. Renaming is usually faster. - Copy the formula down the column. Type the formula in the first data row of a calculated column and press Enter. Excel fills the rest of the column automatically. If it does not, drag the fill handle down; the structured reference adjusts per row because of the @.
- Test that the formula expands. Add a new row directly below the table and type values. A correct structured formula includes the new row in its result without any editing. This is the main benefit over fixed ranges like
$A$2:$A$10. - Convert back only if you must. If you need plain cell references, right-click the table, choose Table > Convert to Range, and confirm. The formulas are replaced with cell addresses, so they no longer expand automatically.
Common Mistakes
- Using the sheet name instead of the table name.
Sheet1[Amount]fails; the reference must start with the table name, for exampleSales[Amount]. - Forgetting the @ inside a table.
[Price]*[Quantity]can behave unpredictably or spill;[@Price]*[@Quantity]is the row-by-row form. - Leaving blank rows or merged cells in the source data. Tables handle these poorly and formulas may skip rows. Clean the data before converting.
- Renaming a header after formulas exist. Excel usually updates references, but external links and copied formulas may break. Check a few results after any rename.
- Typing the table name with a space.
My Sales[Amount]is invalid; useMySales[Amount]or rename the table. - Assuming structured references work in every context. They are not supported in some older add-ins, in certain chart series formulas, or when linking to another workbook that is closed. In those cases use ordinary ranges.
Tips
- Use the Formula AutoComplete list: type the table name and an opening bracket, and Excel shows the available columns.
- Keep one table per sheet where practical; overlapping tables cause reference confusion.
- Name tables by content, not by sheet position, so formulas stay readable if you move things around.
- Use
SUBTOTALwith structured references, such as=SUBTOTAL(109,Sales[Amount]), when you want totals that ignore filtered-out rows. - Press F4 while editing to cycle through absolute and relative forms; structured references mostly ignore this, but it helps when mixing in ordinary ranges.
Troubleshooting
- #NAME? error. The table name or column name is misspelled, or the table was renamed. Check the Table Name box on the Table Design tab and the exact header text.
- Formula returns the wrong total. Confirm the table covers all rows and that no blank rows split the data. Also check for text stored as numbers; use
VALUEor clean the source. - New rows are not included. The formula may be outside the table or the range was converted back to a plain range. Recreate the table or rewrite the formula with structured references.
- Formula will not copy down. The calculated column may be broken by a manually typed value. Clear the column and re-enter the formula in the first data row.
- References break after renaming a column. Undo immediately with Ctrl+Z (Cmd+Z on Mac), then rename more carefully or update the formulas.
- Structured references unavailable in a dialog. Some older dialogs and external links do not accept them. Use a helper column with an ordinary range and reference that instead.
Frequently Asked Questions
What is the basic syntax for an Excel table formula?
TableName[ColumnName] refers to a whole column, and [@ColumnName] refers to the value on the current row. Combine them with normal functions, for example =SUM(Sales[Amount]) or =[@Price]*[@Quantity].
Do structured references work in Excel for the web and on Mac?
Yes. Tables and structured references are supported in Excel for the web and current Mac versions. Menu names differ slightly, but the formula syntax is the same.
Why does my formula show @ automatically?
Excel adds the @ to mean “this row” when you build a formula inside a table. It is correct and keeps the formula row-by-row instead of spilling across the column.
Can I use a table name with spaces?
No. Table names must be a single word with no spaces. Use an underscore or camel case, such as Sales_2024 or SalesData.
How do I refer to a column header that contains a space?
Put the header text in square brackets exactly as written: Sales[Unit Price]. For headers with brackets or apostrophes, rename the header to something simpler.
What happens if I convert the table back to a range?
Structured references are replaced with ordinary cell addresses, so the formulas stop expanding when you add rows. Convert only when you no longer need that behaviour.