简体   繁体   English

Excel使用范围名称作为Excel函数的参数

[英]Excel use range name as an argument to excel function

Excel示例

Let suppose I have several named ranges, P2017.01, P2017.02 and so on. 假设我有几个命名范围,P2017.01,P2017.02,依此类推。 These ranges hold values from year 2017 month 01, month 02, and so on. 这些范围保存着从2017年的月份01,月份02等的值。 I want to sum the month values one-by-one. 我想将月份值一对一地求和。 I want to construct the names of the ranges, and use these constructed names as a function argument. 我想构造范围的名称,并将这些构造的名称用作函数参数。 Example: the prefix 'P2017' is in B3, the index of the month is in C3. 示例:前缀“ P2017”在B3中,月份索引在C3中。 I concatenate B3&'.'&C3 and store the value to D3. 我将B3&'。'&C3连接起来,并将值存储到D3。

In E3 I want to =SUM(INDEX(P2017.01;0;2)), but instead of writing the name P2017.01 I want to acquire the name from the value of cell D3. 在E3中,我想= SUM(INDEX(P2017.01; 0; 2)),但是我不想写名称P2017.01,而是从单元格D3的值中获取名称。

What should I write to E3 to do that? 我应该写什么到E3来做到这一点?

Try following formula... 试试下面的公式...

=SUM(INDEX(INDIRECT(D3),0,2))

Comma (,) or semicolon (;) depens on regional settings. 逗号(,)或分号(;)取决于区域设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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