#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default closest match

I have a list of numbers starting from 50000 to 5000000 in the ragne
"A1:A100")

If I type a value in cell b1, cell c1 should show the nearest value in
the list given in column a

eg. If I type 142000 in cell b1, c1 should show 150000 as it is the
nearest
If 174000 in b1 then 150000 in c1
if 184000 in b1 then 200000 in c1

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
macropod
 
Posts: n/a
Default closest match

Hi sandip,

Try:
=IF(B1-INDEX(A$1:A$100,MATCH(B1,A$1:A$100,1))<OFFSET(INDE X(A$1:A$100,MATCH(B
1,A$1:A$100,1)),1,0)-B1,INDEX(A$1:A$100,MATCH(B1,A$1:A$100,1)),OFFSET(I NDEX(
A$1:A$100,MATCH(B1,A$1:A$100,1)),1,0))

Cheers
--
macropod
[MVP - Microsoft Word]


wrote in message
ups.com...
I have a list of numbers starting from 50000 to 5000000 in the ragne
"A1:A100")

If I type a value in cell b1, cell c1 should show the nearest value in
the list given in column a

eg. If I type 142000 in cell b1, c1 should show 150000 as it is the
nearest
If 174000 in b1 then 150000 in c1
if 184000 in b1 then 200000 in c1

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default closest match

Thank you

macropod wrote:
Hi sandip,

Try:
=IF(B1-INDEX(A$1:A$100,MATCH(B1,A$1:A$100,1))<OFFSET(INDE X(A$1:A$100,MATCH(B
1,A$1:A$100,1)),1,0)-B1,INDEX(A$1:A$100,MATCH(B1,A$1:A$100,1)),OFFSET(I NDEX(
A$1:A$100,MATCH(B1,A$1:A$100,1)),1,0))

Cheers
--
macropod
[MVP - Microsoft Word]


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic
 
Posts: n/a
Default closest match

Try...

=INDEX(A1:A100,MATCH(MIN(ABS(A1:A100-B1)),ABS(A1:A100-B1),0))

....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!

In article . com,
wrote:

I have a list of numbers starting from 50000 to 5000000 in the ragne
"A1:A100")

If I type a value in cell b1, cell c1 should show the nearest value in
the list given in column a

eg. If I type 142000 in cell b1, c1 should show 150000 as it is the
nearest
If 174000 in b1 then 150000 in c1
if 184000 in b1 then 200000 in c1

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default closest match

Thank you.

Domenic wrote:
Try...

=INDEX(A1:A100,MATCH(MIN(ABS(A1:A100-B1)),ABS(A1:A100-B1),0))

...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!


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
Finding Closest Match andyiain Excel Worksheet Functions 1 March 15th 06 07:24 PM
need to select closest match using vlookup if it higher or lower vlookup help pls Excel Discussion (Misc queries) 1 March 1st 06 07:30 PM
find closest match to a reference number in a row of numbers Nick Krill Excel Discussion (Misc queries) 4 December 21st 05 11:59 AM
Match Closest Results from Data Array TheRobsterUK Excel Discussion (Misc queries) 2 September 29th 05 01:48 PM
Closest number match help ... NP Excel Worksheet Functions 0 October 28th 04 09:33 AM


All times are GMT +1. The time now is 11:34 AM.

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"