excel用什么函数查最接近的值
发布网友
发布时间:2022-04-28 21:13
我来回答
共5个回答
热心网友
时间:2022-06-23 05:38
我的想法是:
1、在sheet2中B2单元格填上:=ABS(sheet1!A$1-A2),然后拖到B12;
2、再将sheet2的A2:A12复制到C2:C12;
3、在sheet1的A2填上:=vlookup(min(sheet2!B2:B12),sheet2!B2:C12,2,0),回车即可!
或者这样只需一步,更简洁:
Sheet1!A2
= INDEX(Sheet2!A2:A12,MATCH(MIN(ABS(Sheet2!A2:A12-A1)),ABS(Sheet2!A2:A12-A1),0))
crtl+shift+enter结束公式。
一切OK!
热心网友
时间:2022-06-23 05:38
=IF(A1-INDEX(Sheet2!$A$2:$A$12,MATCH(Sheet1!A1,Sheet2!$A$2:$A$12,1))<INDEX(Sheet2!$A$2:$A$12,MATCH(Sheet1!A1,Sheet2!$A$2:$A$12,1)+1)-A1,INDEX(Sheet2!$A$2:$A$12,MATCH(Sheet1!A1,Sheet2!$A$2:$A$12,1)),INDEX(Sheet2!$A$2:$A$12,MATCH(Sheet1!A1,Sheet2!$A$2:$A$12,1)+1))
Sheet2 里A2:A12按升序排列,
改一下: =IF(A1<Sheet2!$A$12,IF(A1-INDEX(Sheet2!$A$2:$A$12,MATCH(Sheet1!A1,Sheet2!$A$2:$A$12,1))<INDEX(Sheet2!$A$2:$A$12,MATCH(Sheet1!A1,Sheet2!$A$2:$A$12,1)+1)-A1,INDEX(Sheet2!$A$2:$A$12,MATCH(Sheet1!A1,Sheet2!$A$2:$A$12,1)),INDEX(Sheet2!$A$2:$A$12,MATCH(Sheet1!A1,Sheet2!$A$2:$A$12,1)+1)),Sheet2!$A$12)
热心网友
时间:2022-06-23 05:39
编程sqrt函数。
做法:在sheet2里,在B2单元格填上:=sqrt((A2-sheet1!A1)^2), 然后拉动B2的自动填充柄到B12,
将sheet2的A2到A12复制到C2到C12里,然后在sheet1的A2格填上:=vlookup(max(sheet2!B2:B12),sheet2!B2:C12,2) ,这样就行了。
结果:Sheet1 里A2=1.5
热心网友
时间:2022-06-23 05:39
用什么函数我不知道,好像没有个这样的函数吧!不过有办法。
在sheet2里,B2单元格填上:=sqrt((A2-sheet1!A1)^2),然后拉动B2的自动填充柄到B12
将sheet2的A2到A12复制到C2到C12,在sheet1的A2格填上:=vlookup(max(sheet2!B2:B12),sheet2!B2:C12,2)
楼上的答案不错,我咋就没想到呢,学习了。
热心网友
时间:2022-06-23 05:40
A2单元格输入公式:
=SUM((ABS(A1-Sheet2!A2:J2)=MIN(ABS(A1-Sheet2!A2:J2)))*(Sheet2!A2:J2))
按CTRL+SHIFT+ENTER三键