如何在Excel中找到最接近的数字并返回相应的单元格? [英] How do I find a closest number in Excel and bring back a corresponding cell?
问题描述
第1行:YORK / LEEDS / WINDSOR / CHESHIRE
Row 1 : YORK / LEEDS / WINDSOR / CHESHIRE
行2:10/8/6/9
Row 2 : 10 / 8 / 6 / 9
所以我想在每一行的其他数据中找到与约克最接近的比赛,并带回最接近的比赛的标题。
So I want to find the closest match to York in the other data across each row, and bring back the title of the closest match.
所以答案我想要带回第2行(约克= 10)是CHESHIRE,因为9最接近10。
So the answer i want to bring back for row 2 (York = 10) is "CHESHIRE" as 9 is the closest to 10.
谢谢!
推荐答案
如果您的数据位于 A1:D2
,请尝试此数组公式
If your data is in A1:D2
try this "array formula"
= INDEX(B $ 1:D $ 1,MATCH(MIN(ABS(A2-B2:D2)),ABS(A2-B2:D2),0))
使用确认CTRL + SHIFT + ENTER
如果两个或更多的值相同,则匹配将与左边的第一个匹配。
If 2 or more values are equally close then the match will be with the first one from the left.....
这篇关于如何在Excel中找到最接近的数字并返回相应的单元格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!