ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Finding Closest Match (https://www.excelbanter.com/excel-worksheet-functions/77493-finding-closest-match.html)

andyiain

Finding Closest Match
 

Hi,

I know there are methods to find the closest match to a number that is
either greater than or smaller than a reference number but how do you
find the closest number regardless of whether its larger or smaller.

Any help would be very welcome.

Regards
Andy.


--
andyiain
------------------------------------------------------------------------
andyiain's Profile: http://www.excelforum.com/member.php...fo&userid=8335
View this thread: http://www.excelforum.com/showthread...hreadid=522640


Herbert Seidenberg

Finding Closest Match
 
Assuming there are no duplicates in your list,
enter as an array formula
=SUMPRODUCT(((ABS(list-target))=MIN(ABS(list-target)))*list)
otherwise use this array formula for the first closest match
=INDEX(list,MATCH(MIN(ABS(list-target)),(ABS(list-target)),0))



All times are GMT +1. The time now is 12:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com