开发者

How to lookup table name from cell in iWork Numbers?

开发者 https://www.devze.com 2023-02-02 01:43 出处:网络
I have a spreadsheet that has quite a few tables and I wonder what would be the formula to lookup table name from cell in iWork Numbers? For example I have table with 开发者_Go百科name TableA, inside

I have a spreadsheet that has quite a few tables and I wonder what would be the formula to lookup table name from cell in iWork Numbers? For example I have table with 开发者_Go百科name TableA, inside of that table I want to put something like "=$B1" or whatever to get the name "January01" in it. Just typing it is not acceptable, cause those table names will change for multiple day of the month (we planning to have 30-31 tables in one spreadsheet and have 12 spreadsheets for number of months).


It is possible to use text in another cell to specify a sheet and/or table name in the cell or range address within a formula in another cell. You can use the INDIRECT function.

"The INDIRECT function returns the contents of a cell or range referenced by an address specified as a string value."

from the iWork Numbers function browser

Example:

Assume the cells in column A of a particular table contain the names of the sheets in the workbook.

In column B you could count the number of cells that contain the text 'equal' in column D of Table 1 in each sheet using:

=COUNTIF(INDIRECT($A2&"::Table 1::$D", 1),"=equal")

Here the sheet name is specified in column A so the formula can be used for the entire column without having to manually edit the formula to specify the sheet name.


According to this support forum entry that is not possible. Came across it as I was looking for a solution to the same problem.


This is a very old thread, but here is how to get the table name:

You need to use the REFERENCE.NAME function to get the name of the table (plus some extraneous info, that you get rid of by using the TEXTBEFORE function).

TEXTBEFORE(REFERENCE.NAME(SomeTableName::$A$1,1),":")

The entry "SomeTableName::$A$1" is a random cell reference (in this case cell A1) from the table whose name you are interested to get. During formula entry, you merely click on a cell of the table in question to generate this reference, and then lock cell column and row, as needed.

The parameter "1" following the cell reference tells the REFERENCE.NAME function to return the name of the table and the cell name. There is no option to return just the table name.

The TEXTBEFORE function truncates the returned string to everything before the first colon, returning just the table name.

0

精彩评论

暂无评论...
验证码 换一张
取 消