#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Excel function

How can i find the nearest value to a value in an array or column

i.e. find nearset to 14 in column of vlaue 1,5,8,13,16,18
need this to come back with value of 13
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Excel function



=INDEX(A1:A6,MATCH(MIN(ABS(A1:A6-14)),(ABS(A1:A6-14)),0))

entered with ctrl + shift & enter



--


Regards,


Peo Sjoblom





"Holdey" wrote in message
...
How can i find the nearest value to a value in an array or column

i.e. find nearset to 14 in column of vlaue 1,5,8,13,16,18
need this to come back with value of 13



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 229
Default Excel function

If the column is always sorted ascending, you can use VLOOKUP to
return the next lowest value to lookup.

=VLOOKUP(14,{1;5;8;13;16;18},1,TRUE)

will return 13.

If A1=14 and B1:B6={1;5;8;13;16;18} then you can use this function:

=VLOOKUP(A1,$B$1:$B$6,1,TRUE)

On Dec 12, 11:16 am, Holdey wrote:
How can i find the nearest value to a value in an array or column

i.e. find nearset to 14 in column of vlaue 1,5,8,13,16,18
need this to come back with value of 13


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
Excel 2002: Auto Sum function not working in large Excel file Mr. Low Excel Discussion (Misc queries) 3 May 25th 07 03:36 PM
challenge! javascript function into excel function Kamila Excel Worksheet Functions 2 February 19th 07 06:35 AM
Excel Workday Function with another function Monique Excel Discussion (Misc queries) 2 April 27th 06 01:11 PM
Can you nest a MID function within a IF function in Excel Dawn-Anne Excel Worksheet Functions 2 March 4th 05 01:37 PM


All times are GMT +1. The time now is 06:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"