简体   繁体   中英

Excel - Use string for named range

In a sheet, I have some named range - say test1, test2 and test3, with value 1, 4 an 7.

In another sheet, I have value 2, 1, 3 in columns A, and I would like to get the corresponding named range value in column B, respectively test2, test1 and test3 (4, 1 and 7).

My initial idea was to use concatenate to build the names of the ranges, but I have no idea how to get a named range by its name as a string.

How could I achieve what I want ?

If the values are stored in cells, you can use INDIRECT:

=INDIRECT("test"&A1)

for example, will return 4 if cell A1 contains the value 2, since that is the value in test2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM