Couldn't find a built in formula to do this, and didn't want to write VBA. So found a way to get the name of a table in Excel. It's a little clunky and I'm hoping for a cleaner solution,but here it is. Used three functions: MID, FORMULATEXT, and INDEX.
Have a table with name tblHarry
1. cell A1: =index(tblHarry,1,1)
2. cell A2: =MID(FORMULATEXT(A1),8,FIND(",",FORMULATEXT(A1),1)-8)
value in cell A1: 52 (this is arbitrary, it's just the value in row 1, column 1 of the table)
value in cell A2: tblHarry
FORMULATEXT(A1) returns the string value "=index(tblHarry,1,1)"
Then the MID function just pulls out the table name from the text string.
The clunky part is FORMULATEXT requires a reference to a cell, one cannot put the formula into the argument of FORMULATEXT, so it requires two formulas to get the result: The cell with the index formula and the cell with the MID(FORMULATEXT(...) formula.
Have a table with name tblHarry
1. cell A1: =index(tblHarry,1,1)
2. cell A2: =MID(FORMULATEXT(A1),8,FIND(",",FORMULATEXT(A1),1)-8)
value in cell A1: 52 (this is arbitrary, it's just the value in row 1, column 1 of the table)
value in cell A2: tblHarry
FORMULATEXT(A1) returns the string value "=index(tblHarry,1,1)"
Then the MID function just pulls out the table name from the text string.
The clunky part is FORMULATEXT requires a reference to a cell, one cannot put the formula into the argument of FORMULATEXT, so it requires two formulas to get the result: The cell with the index formula and the cell with the MID(FORMULATEXT(...) formula.