简体   繁体   English

在动态行中查找最后一个值(Excel)

[英]Finding the Last Value in a Dynamic Row (Excel)

I'm attempting to find the last available row in a dynamic row in another worksheet, and am having difficulties getting the formula working. 我试图在另一个工作表中的动态行中找到最后一个可用行,并且很难使公式起作用。

I'm was using the ol' faithful 99^99 lookup to find the value, 我正在使用OL忠实的99 ^ 99查找来找到值,

=LOOKUP(99^99,'Import'!4:4)

And it worked well while the data in the Calculations sheet matched up with the Import sheet. 当“计算”表中的数据与“导入”表匹配时,它运行良好。 However (for example) row 48 in the Calculations sheet might correspond with row 51 in the Import sheet, whilst row 49 in Calculations would match with row 68. 但是,例如,“计算”表中的第48行可能与“导入”表中的第51行相对应,而“计算”中的第49行将与第68行匹配。

In the above instance I want to replace the "4:4" with a dynamic reference to another row based on a lookup. 在上面的例子中,我想用基于查找的对另一行的动态引用替换“ 4:4”。

My best attempt so far is: 到目前为止,我最好的尝试是:

=LOOKUP(99^99,INDIRECT(“'Import'!”&MATCH($A4,'Import'!$A:$A,0)&”:”&MATCH($A4,'Import'!$A:$A,0)))

Or in psuedo: 或在伪装中:

=LOOKUP(99^99,("'Import'!" & R & ":" & R))
Where R = Row in another sheet, corresponding to the value in column A of the current sheet.

But it's not giving me working results. 但这并没有给我工作成果。 I've tried a handful of variations with MIN, ROWS, LOOKUP, etc. 我已经尝试了MIN,ROWS,LOOKUP等几种变体。

I would use INDEX/MATCH where possible so it would look something like this 我将在可能的地方使用INDEX / MATCH,所以它看起来像这样

=LOOKUP(99^99,INDEX(Import!$A$1:$AA$100,MATCH(A1,Import!$A$1:$A$100,0),0))

adjusting ranges as required. 根据需要调整范围。

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

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