简体   繁体   English

在Excel中更新单元格位置

[英]Update cell location in excel

I wanted to get the cell from one sheet based on cell value in other sheet 我想根据另一张纸上的单元格值从一张纸上获得单元格
eg. 例如。

2 sheets : x,y 2张:x,y

I want cell value from sheet "y" and its cell is "A" and column value of "A" depend on sheet x and cell B1 我想要工作表“ y”的单元格值,其单元格为“ A”,“ A”的列值取决于工作表x和单元格B1

  eg. y!A(x!$B1+1)

However,y!A gets evaluated first and I get error. 但是,y!A首先被评估,但我得到了错误。

Can anyone suggest solution ? 有人可以建议解决方案吗?

This formula should do it: 这个公式应该做到:

=INDIRECT("y!r1c"&x!B1, FALSE)

This assumes x!B1 holds the column as a number 假设x!B1将列保留为数字

y!A(x!$B1+1) y!A(x!$ B1 + 1)

You can use INDIRECT like Dave mentioned 您可以像提到的Dave那样使用INDIRECT

y is the Sheet
A is the column
(x!$B1+1) is the row

However since you want to pickup the row part and not the column part, Dave's formula needs to be written as 但是,由于您要拾取行部分而不是列部分,因此Dave的公式需要写为

=INDIRECT("y!r"&(x!B1+1)&"c1", FALSE)

Alternatively you can use OFFSET 或者,您可以使用OFFSET

=OFFSET(y!A1,x!B1,0)

No need to Add +1 Offset will take care of that. 无需添加+1偏移即可解决这一问题。

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

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