Google Sheet Vlookup 多个条件

问题描述 投票:0回答:1

我有一个数据库表,其中包含产品列表和每个产品的详细信息,包括但不限于产品尺寸、成本、部门等。在名为 PriceTiers 的单独工作表上,我有一个价格级别列表以及每个价格级别的要求/设置,例如最小产品尺寸、最大产品尺寸、最小成本、最大成本、部门等。我的目标是在我的数据库表上有一个数组公式,它使用产品详细信息在 PriceTiers 表上查找正确的价格水平,类似于具有多个条件的 vlookup。

我很困惑,因为 Vlookup(A1:A&H1:H&W1:W... 的更常见方法不起作用,因为条件包括多个大于和小于语句,例如大于 1 升和小于 10 升。我尝试使用数组公式中的过滤器会导致行不匹配,并且查询似乎不起作用,因为单元格引用必须重复所有行。

以下 DGET 公式确实有效,但它在数组公式中不起作用,这是我的目标,因此不必重复复制 5,000 行。任何帮助表示赞赏。我已经创建了一个示例工作簿here

=IF(ROW(A1:A)=1,"Price Line Lookup",IFERROR(IF(A1="",,
IF(I1>50,
DGET(PriceTiers!A:AC,"Price Line Code",{"Subcategory Code",                      "SU-Min","SU-Max","Cost_Min","Cost_Max";H1,                "<="&X1,">="&X1,"<="&AT1,">="&AT1}),
DGET(PriceTiers!A:AC,"Price Line Code",{"Subcategory Code","Size_Min","Size_Max","SU-Min","SU-Max","Cost_Min","Cost_Max";H1,"<="&W1,">="&W1,"<="&X1,">="&X1,"<="&AT1,">="&AT1})))))
google-sheets google-sheets-formula array-formulas
1个回答
0
投票

下拉公式转换为

array-style

=map(A:A,H:H,I:I,W:W,X:X,AT:AT,lambda(a,h,i,w,x,at,
 IF(ROW(a)=1,"Price Line Lookup",IFERROR(IF(a="",,
IF(i>50,
DGET(PriceTiers!A:AC,"Price Line Code",{"Subcategory Code",                      "SU-Min","SU-Max","Cost_Min","Cost_Max";h,                "<="&x,">="&x,"<="&at,">="&at}),
DGET(PriceTiers!A:AC,"Price Line Code",{"Subcategory Code","Size_Min","Size_Max","SU-Min","SU-Max","Cost_Min","Cost_Max";h,"<="&w,">="&w,"<="&x,">="&x,"<="&at,">="&at})))))))
© www.soinside.com 2019 - 2024. All rights reserved.