How to Return the Name or Number of an Excel Table
Question details
The user needs a formula to dynamically return the name or number of the table containing a specific cell. This is intended to create a single generic sort formula that can be reused across identically structured worksheets without manual edits.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating generic, reusable formulas across multiple worksheets containing identical table formats, such as yearly checkbook registers.
- Observed behavior
- Excel does not offer a native, built-in worksheet function to dynamically return the structured table name or number from a cell reference.
Because there is no standard built-in function to pull a table name, make sure the Developer tab is enabled in your ribbon if you plan to use VBA scripts for a custom solution.
Use a VBA User-Defined Function (UDF)
Create a custom VBA script to extract the table name of any referenced cell.
Since a native formula does not exist, a User-Defined Function in VBA is the most direct way to dynamically fetch the table name a specific cell belongs to. Once created, this custom function can be used inside your worksheet just like any standard Excel formula.
Press ALT + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.
Click 'Insert' in the top menu and select 'Module' to create a blank script window.
Paste a short VBA function that uses 'Range.ListObject.Name' to identify the table name of the targeted cell range.
Return to your worksheet and type your new custom formula (e.g., '=GetTableName(A1)') in the cell where you need the table name to appear.

Use INDIRECT with Standardized Table Names
Apply consistent naming conventions and the INDIRECT function to mimic generic reusable formulas.
Manage Complex Spreadsheets for Free with WPS Office
While extracting table names dynamically requires workarounds like VBA in any spreadsheet program, WPS Office provides a fully compatible, free, and lightweight alternative to Microsoft Office. It seamlessly opens your Excel files, supports advanced structured references, and ensures a smooth workflow.
- 1. Download and Install: Visit the WPS Office website and download the free installation package for your PC or Mac.
- 2. Open Your Excel File: Launch WPS Spreadsheet and open your existing .xlsx or .xlsm files seamlessly without losing data or layout formatting.
- 3. Work with Formulas: Continue using your advanced array formulas, VBA macros, and structured references exactly as you would in Microsoft Excel.

Frequently Asked Questions
Can the CELL function return an Excel table name?
No, the built-in CELL function can return the worksheet name, file path, cell address, or cell formatting, but it does not support extracting a structured table name.
How can I manually find the name of a table in Excel?
Click any cell inside your table, navigate to the 'Table Design' tab on the ribbon, and look at the 'Table Name' box on the far left side. You can also edit and rename your table from this box.
Why would I need a generic formula for tables on multiple sheets?
When users maintain identical data structures across multiple tabs (like monthly financial logs), generic formulas allow them to copy and paste summaries or sorting functions without manually rewriting the table name for each new sheet.




