英文:
Advance Excel Lookup function
问题
我想使用查找功能来查找特定值,如果该值不存在,它需要查找其他列。
如果金额存在于Amount1列中,它需要选择它...否则它需要从amount2列中选择金额。
输出列应该将所有值放在单个列中。
英文:
I wanted to use lookup function to lookup for specific value and if the value doesn't exist, it needs to lookup other column.
If the amount is present in Amount1 column it needs to pick it up ..else it needs to pick the amount from amount2 column.
Output column should have all the values in single column
答案1
得分: 2
尝试使用 BYROW()
与 隐式交集 运算符 @
。
=BYROW(F2:F6, LAMBDA(x, @TOROW(FILTER(B2:D6, x = A2:A6, ""))))
或者,尝试按照 JvdV 先生提到的方法,使用 MMULT()
。
• 公式在单元格 H2
中使用
=MMULT(B2:D6*1, {1;1;1})
英文:
Try using BYROW()
with an implicit intersection operator @
=BYROW(F2:F6,LAMBDA(x,@TOROW(FILTER(B2:D6,x=A2:A6,""),1)))
Or, try as mentioned by JvdV Sir, using MMULT()
• Formula used in cell H2
=MMULT(B2:D6*1,{1;1;1})
答案2
得分: 1
使用嵌套的 XLOOKUP()
。尝试-
=XLOOKUP(1,XLOOKUP(G2,$A$2:$A$6,$B$2:$D$6),XLOOKUP(G2,$A$2:$A$6,$B$2:$D$6),,1)
英文:
Use nested XLOOKUP()
. Try-
=XLOOKUP(1,XLOOKUP(G2,$A$2:$A$6,$B$2:$D$6),XLOOKUP(G2,$A$2:$A$6,$B$2:$D$6),,1)
答案3
得分: 1
也许可以考虑另一种方法:
使用辅助列获取每行的最大值,然后使用匹配进行索引。
然后可以是这些值的平均值或最小值等等。
还要注意输入的顺序不需要匹配输出的顺序。
英文:
Well, perhaps another method to consider:
Use a helper column to get the max value for each row then index with match:
Then it could be the average of the values or the minimum etc etc
Also note that the order of the input does not need to match the order of the output.
答案4
得分: 1
=SUM(FILTER($B$2:$D$11,$A$2:$A$11=$F2,""))
=LET(sl,A2:A11,sr,B2:D11,dl,F2:F6,
BYROW(dl,LAMBDA(r,SUM(FILTER(sr,sl=r,""))))
=SUM(FILTER(Table1[[Amt1]:[Amt3]],Table1[Fruit]=[@Fruit],""))
英文:
Sum Up Rows of Filtered Data
In cell G2
:
Basic (Copy Down)
=SUM(FILTER($B$2:$D$11,$A$2:$A$11=$F2,""))
Dynamic (Spills)
=LET(sl,A2:A11,sr,B2:D11,dl,F2:F6,
BYROW(dl,LAMBDA(r,SUM(FILTER(sr,sl=r,"")))))
Excel (Structured) Table
In the first cell (row) of the Amount
column:
=SUM(FILTER(Table1[[Amt1]:[Amt3]],Table1[Fruit]=[@Fruit],""))
The remaining cells (rows) get populated automatically.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论