logo
search
Function Problems

How to Return the Name or Number of an Excel Table

Phi Hung VoPhi Hung Vo Oct 16, 2026 868 views

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.

How to Return the Name or Number of an Excel Table
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the VBA Editor

Press ALT + F11 on your keyboard to open the Visual Basic for Applications (VBA) editor.

2
Insert a New Module

Click 'Insert' in the top menu and select 'Module' to create a blank script window.

3
Enter the Custom Code

Paste a short VBA function that uses 'Range.ListObject.Name' to identify the table name of the targeted cell range.

4
Use the Formula

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 a VBA User-Defined Function (UDF)
Macro-Enabled Workbook: Remember to save your file as an Excel Macro-Enabled Workbook (.xlsm) so the custom VBA function continues to work in the future.
Free Microsoft Office alternative

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. 1. Download and Install: Visit the WPS Office website and download the free installation package for your PC or Mac.
  2. 2. Open Your Excel File: Launch WPS Spreadsheet and open your existing .xlsx or .xlsm files seamlessly without losing data or layout formatting.
  3. 3. Work with Formulas: Continue using your advanced array formulas, VBA macros, and structured references exactly as you would in Microsoft Excel.
Free, lightweight, and fast alternative to Microsoft OfficeFully compatible with Microsoft Excel formats (.xlsx, .xlsm, .csv)Supports advanced array formulas, macros, and structured table referencesFamiliar user interface makes switching effortless
microsoft office alternative - wps office

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.