ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   referencing a name from a cell value (https://www.excelbanter.com/excel-discussion-misc-queries/97255-referencing-name-cell-value.html)

name

referencing a name from a cell value
 

Is it possible, to reference a defined name by referencing a cell whose
value is the same as the defined name?

There are 2 names, animal.dog and animal.cat, that reference a range of
cells: A1:D1 and A2:D2, respectively.

I would like to keep the absolute property of the named ranges with
respect to the column orientation. If I reference animal.dog on
another worksheet from the cell Ax, I would like it to return A1.

Cell A10's value is: animal.cat

Looking for way to accomplish something like the following. In cell
Cx: =name(A.10). And have it return the value of C1.

If this is possible, would like to take it a step further and use a
combination of a string and a reference to a cell's value to reference
a defined name.

Imagine it could look something like this. In cell Cx:
=refname("animal."&A10).

And the value returned would be from C column of the animal.dog defined
name, C1.


--
name
------------------------------------------------------------------------
name's Profile: http://www.excelforum.com/member.php...o&userid=34115
View this thread: http://www.excelforum.com/showthread...hreadid=557735


CaptainQuattro

referencing a name from a cell value
 

I think what you are looking for is the =INDIRECT function.

Example:

Range A1:D1 is named animal.dog as in your example

A1 = 10 B1 = 20 C1 = 30 D1 = 40

If cell F1 contains the text animal.dog

the formula =SUM(INDIRECT(F1)) will return the sum of cells A1 through
D1, i.e. 100











name Wrote:
Is it possible, to reference a defined name by referencing a cell whose
value is the same as the defined name?

There are 2 names, animal.dog and animal.cat, that reference a range of
cells: A1:D1 and A2:D2, respectively.

I would like to keep the absolute property of the named ranges with
respect to the column orientation. If I reference animal.dog on
another worksheet from the cell Ax, I would like it to return A1.

Cell A10's value is: animal.cat

Looking for way to accomplish something like the following. In cell
Cx: =name(A.10). And have it return the value of C1.

If this is possible, would like to take it a step further and use a
combination of a string and a reference to a cell's value to reference
a defined name.

Imagine it could look something like this. In cell Cx:
=refname("animal."&A10).

And the value returned would be from C column of the animal.dog defined
name, C1.



--
CaptainQuattro
------------------------------------------------------------------------
CaptainQuattro's Profile: http://www.excelforum.com/member.php...o&userid=32763
View this thread: http://www.excelforum.com/showthread...hreadid=557735



All times are GMT +1. The time now is 12:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com