英文:
Excel formula which returns the cell value for the intersection of rows with specific name and specific column?
问题
有没有一种Microsoft Excel公式,可以返回位于特定列中的最后一个单元格的值,并与给定名称的行交叉?
英文:
Is there a Microsoft Excel formula which returns a cell value for the last cell that is located in a specific column and in the same time intersects rows with a given name?
答案1
得分: 2
使用Office 365,我们可以筛选范围并返回满足条件的所有数据的数组。然后使用TAKE函数获取最后一个:
=TAKE(FILTER(H:H,((A:A=<row_name>)*(H:H<>"")),1)
另一个选项适用于2010年之后的所有版本,它利用AGGREGATE函数的能力来处理数组并忽略由于除以0而引起的任何错误。其中的14表示获取在(A:A=<row_name>)*(H:H<>"")返回1的情况下最大的行号,然后将该行号传递给INDEX函数:
=INDEX(H:H,AGGREGATE(14,7,ROW(H:H)/((A:A=<row_name>)*(H:H<>"")),1)
英文:
With Office 365, We can filter the range and return an array of all that meet the criteria. Then use TAKE to grab the last one:
=TAKE(FILTER(H:H,((A:A=<row_name>)*(H:H<>""),""),-1)
Another option that works in all Versions after 2010 This uses AGGREGATES ability to work with arrays and ignore any errors cause by dividing by 0
. The 14 grabs the largest row number where the (A:A=<row_name>)*(H:H<>"")
returns a 1
. It then passes that row number to the INDEX:
=INDEX(H:H,AGGREGATE(14,7,ROW(H:H)/((A:A=<row_name>)*(H:H<>"")),1))
答案2
得分: 0
以下是翻译好的部分:
通用公式表达式:
=LOOKUP(2,1/(<row_header_range>=<string_value>)*(<column_range><>""),<column_range>)
示例(在乌克兰语环境中,,
被替换为 ;
):
=LOOKUP(2;1/((A:A="Row_name")*(H:H<>""));H:H))
LOOKUP
函数根据指定的搜索条件,搜索列中的最后一个非空单元格。
英文:
Generic formula expression:
=LOOKUP(2,1/(<row_header_range>=<string_value>)*(<column_range><>""),<column_range>)
and the example (in Ukrainian locale, where ,
is replaced by ;
:
=LOOKUP(2;1/((A:A="Row_name")*(H:H<>""));H:H))
LOOKUP
function searches for the last non-empty cell in the column, based on the specified search criteria.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论