英文:
XLOOKUP with multiple criteria always gives array size error
问题
I can never get XLOOKUP to work with multiple criteria. All I ever get is "Array arguments to XLOOKUP are of different size" no matter what data set I use.
Eventually I want to use this in a work center/product type lookup that will be something like "Metal work & Soldering" to get something like items per FTE day = 20
Working in Google Sheets. What am I doing wrong? Thanks
Column A
Header: Item 1
Ships
Cars
Airplanes
Motorcycles
Column B
Header: Item 2
Water
Roads
Sky
Roads
Column C:
Header: Price
300
50
120
20
Criteria 1/Cell F1: Cars
Criteria 2/Cell F2: Roads
Formula: =XLOOKUP(F1&F2,A2:A5&B2:B5,C2:C5)
Desired result: 50
Actual result: #N/A Array arguments to XLOOKUP are of different size
英文:
I can never get XLOOKUP to work with multiple criteria. All I ever get is "Array arguments to XLOOKUP are of different size" no mater what data set I use.
Eventually I want to use this in a work center/product type lookup that will be something like "Metal work & Soldering" to get something like items per FTE day = 20
Working in Google Sheets. What am I doing wrong? Thanks
[[[enter image description here](https://i.stack.imgur.com/pbUqY.jpg)](https://i.stack.imgur.com/xwkn3.jpg)](https://i.stack.imgur.com/yPMDw.jpg)
Column A
Header: Item 1
Ships
Cars
Airplanes
Motorcycles
Column B
Header: Item 2
Water
Roads
Sky
Roads
Column C:
Header: Price
300
50
120
20
Criteria 1/Cell F1: Cars
Criteria 2/Cell F2: Roads
Formula: =XLOOKUP(F1&F2,A2:A5&B2:B5,C2:C5)
Desired result: 50
Actual result: #N/A Array arguments to XLOOKUP are of different size
答案1
得分: 1
需要在你连接的两列周围加上arrayformula
或index
,如A2:A5&B2:B5
,否则结果只会是A2&B2
,显然只有一行数据,与具有4行数据的C2:C5
相比,这会导致不同大小的错误。
尝试:xlookup(F1&F2,index(A2:A5&B2:B5),C2:C5,)
。
英文:
You need an arrayformula
or index
wrapped around the 2 columns you were concatenating A2:A5&B2:B5
otherwise the result is just goin' to be A2&B2
which obviously has just one row data compared to C2:C5
with 4 rows of data thus resulting in different size error
try: xlookup(F1&F2,index(A2:A5&B2:B5),C2:C5,)
答案2
得分: -1
你可以使用筛选器来进行索引/匹配。我试图理解的是这是否是Gsheet的限制(不支持XLOOKUP函数中的“多条件布尔表达式”,就像Excel支持的那样),还是它实际上支持,但应该使用不同的措辞方法...
英文:
You can use filter either index/match.
What I am trying to understand if it is a "limit" of Gsheet (that does not support that XLOOKUP function "Multiple Criteria Boolean Expressions", like Excel does instead or it actually supports it, but there should be a different phrasing method..)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论