为什么ArrayFormula不能与LOOKUP函数一起使用?

时间:2019-07-13 00:15:34

标签: google-sheets google-sheets-formula array-formulas gs-vlookup

我正在尝试根据F2中的查找值(邮政编码/邮政编码)从列C中提取值(送货区域代码)。查找值介于最小和最大范围之间。

enter image description here

这是样本表-https://docs.google.com/spreadsheets/d/1JOMxM9gerT5zLVW0ZJtgjiF04Sw5bAXAPqtGXmst6cQ/edit?usp=sharing

我找到了一个适用于excel的公式:

=LOOKUP(2,1/((F2>=A2:A351)/(F2<=B2:B351)),C2:C351)

但是它不适用于Google表格。我根据另一个答案-Using LOOKUP (2,1/ function in Google Sheets

添加了arrayformula
=ARRAYFORMULA(LOOKUP(2,1/((F2>=A2:A351)/(F2<=B2:B351)),C2:C351))

但是此公式仍返回#N / A ...

在示例中,邮政编码3185应该返回值MEL

0

1 个答案:

答案 0 :(得分:0)

改为使用以下公式:

=ARRAYFORMULA(VLOOKUP(F2, 
 {INDIRECT("A2:A"&COUNTA(A:A))*1, 
  INDIRECT("D2:D"&COUNTA(A:A))}, 2))

pytest docs

相关问题