Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sorting 数组公式查找行中的闭合值_Sorting_If Statement_Google Sheets_Google Sheets Formula_Array Formulas - Fatal编程技术网

Sorting 数组公式查找行中的闭合值

Sorting 数组公式查找行中的闭合值,sorting,if-statement,google-sheets,google-sheets-formula,array-formulas,Sorting,If Statement,Google Sheets,Google Sheets Formula,Array Formulas,我试图转换这个,以找到数组中最接近的匹配项,但我不认为你可以这样做 =VLOOKUP(a1,SORT(range,1,TRUE),2) =ArrayFormula(iferror(VLOOKUP(Q2:Q,SORT(R2:S,1,TRUE),2),"")) 关于如何制作一个在一行中查找闭合值的数组公式,还有其他想法吗?试试: =ARRAYFORMULA(IF(ABS(B2:B-C2:C)<ABS(B2:B-D2:D), C2:C, D2:D)) 共享您的工作表副本 =ARRAYFOR

我试图转换这个,以找到数组中最接近的匹配项,但我不认为你可以这样做

=VLOOKUP(a1,SORT(range,1,TRUE),2)

=ArrayFormula(iferror(VLOOKUP(Q2:Q,SORT(R2:S,1,TRUE),2),""))
关于如何制作一个在一行中查找闭合值的数组公式,还有其他想法吗?

试试:

=ARRAYFORMULA(IF(ABS(B2:B-C2:C)<ABS(B2:B-D2:D), C2:C, D2:D))

共享您的工作表副本
=ARRAYFORMULA(TRIM(TRANSPOSE(QUERY(TRANSPOSE(
 IF(QUERY(TRANSPOSE(QUERY(TRANSPOSE(ABS(B2:B-C2:G)), 
 "select "&TEXTJOIN(",", 1, "min(Col"&ROW(B2:B)-ROW(B2)+1&")")&"")), 
 "select Col2")=ABS(B2:B-C2:G), C2:G, )),,99^99))))