Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
NP NP is offline
external usenet poster
 
Posts: 6
Default Closest number match help ...

Looking for a way to find the number that falls closest to another number in
Excel ...

Cell A1 contains value 750
Cell A2 contains value 1500
Cell A3 contains value 3000

When I enter a value in cell A5 (e.g. 800), the result I would like retuned
in cell B5 is the number from cell a1, a2 or a3 which is closest to the
value in A5. Anyone any ideas how to do this please?

Many thanks,

NP.


  #2   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,885
Default Closest number match help ...

Hi
try the followung array formula (entered with CTRL+SHIFT+ENTER):
=INDEX(A1:A4,MATCH(MIN(ABS(A1:AA4-A5)),ABS(A1:A4-A5),0))

--
Regards
Frank Kabel
Frankfurt, Germany

"NP" schrieb im Newsbeitrag
...
Looking for a way to find the number that falls closest to another

number in
Excel ...

Cell A1 contains value 750
Cell A2 contains value 1500
Cell A3 contains value 3000

When I enter a value in cell A5 (e.g. 800), the result I would like

retuned
in cell B5 is the number from cell a1, a2 or a3 which is closest to

the
value in A5. Anyone any ideas how to do this please?

Many thanks,

NP.



  #3   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Closest number match help ...

Hi,
I addapted a formula from John Walkenbach
Name A1-A3 Data
Name A5 Target

Enter this formula as an array (Shift-Ctrl-Enter
=INDIRECT(ADDRESS(ROW(data)+MATCH(MIN(ABS(target-data)),ABS(target-data),0)-1,COLUMN(data)+0))

Note that if two numbers are the dame distance from your target it will
select the first one

Hope this helps

"NP" wrote:

Looking for a way to find the number that falls closest to another number in
Excel ...

Cell A1 contains value 750
Cell A2 contains value 1500
Cell A3 contains value 3000

When I enter a value in cell A5 (e.g. 800), the result I would like retuned
in cell B5 is the number from cell a1, a2 or a3 which is closest to the
value in A5. Anyone any ideas how to do this please?

Many thanks,

NP.



  #4   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
NP NP is offline
external usenet poster
 
Posts: 6
Default Closest number match help ...

Thanks for that. However, I forgot to also mention that I would like the
value returned to be higher. For example ... if A5 contains 800 then I would
like the value returned in B5 to be 1500.

Any ideas please?

Many thanks,

NP.


"Frank Kabel" wrote in message
...
Hi
try the followung array formula (entered with CTRL+SHIFT+ENTER):
=INDEX(A1:A4,MATCH(MIN(ABS(A1:AA4-A5)),ABS(A1:A4-A5),0))

--
Regards
Frank Kabel
Frankfurt, Germany

"NP" schrieb im Newsbeitrag
...
Looking for a way to find the number that falls closest to another

number in
Excel ...

Cell A1 contains value 750
Cell A2 contains value 1500
Cell A3 contains value 3000

When I enter a value in cell A5 (e.g. 800), the result I would like

retuned
in cell B5 is the number from cell a1, a2 or a3 which is closest to

the
value in A5. Anyone any ideas how to do this please?

Many thanks,

NP.





  #5   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,885
Default Closest number match help ...

Hi
then try the following array formula
=INDEX(A1:A4,MATCH(TRUE,A1:A4=800,0))

--
Regards
Frank Kabel
Frankfurt, Germany

"NP" schrieb im Newsbeitrag
...
Thanks for that. However, I forgot to also mention that I would like

the
value returned to be higher. For example ... if A5 contains 800 then

I would
like the value returned in B5 to be 1500.

Any ideas please?

Many thanks,

NP.


"Frank Kabel" wrote in message
...
Hi
try the followung array formula (entered with CTRL+SHIFT+ENTER):
=INDEX(A1:A4,MATCH(MIN(ABS(A1:AA4-A5)),ABS(A1:A4-A5),0))

--
Regards
Frank Kabel
Frankfurt, Germany

"NP" schrieb im Newsbeitrag
...
Looking for a way to find the number that falls closest to

another
number in
Excel ...

Cell A1 contains value 750
Cell A2 contains value 1500
Cell A3 contains value 3000

When I enter a value in cell A5 (e.g. 800), the result I would

like
retuned
in cell B5 is the number from cell a1, a2 or a3 which is closest

to
the
value in A5. Anyone any ideas how to do this please?

Many thanks,

NP.








  #6   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
NP NP is offline
external usenet poster
 
Posts: 6
Default Closest number match help ...

Thats great. Many thanx.

NP

"Frank Kabel" wrote in message
...
Hi
then try the following array formula
=INDEX(A1:A4,MATCH(TRUE,A1:A4=800,0))

--
Regards
Frank Kabel
Frankfurt, Germany

"NP" schrieb im Newsbeitrag
...
Thanks for that. However, I forgot to also mention that I would like

the
value returned to be higher. For example ... if A5 contains 800 then

I would
like the value returned in B5 to be 1500.

Any ideas please?

Many thanks,

NP.


"Frank Kabel" wrote in message
...
Hi
try the followung array formula (entered with CTRL+SHIFT+ENTER):
=INDEX(A1:A4,MATCH(MIN(ABS(A1:AA4-A5)),ABS(A1:A4-A5),0))

--
Regards
Frank Kabel
Frankfurt, Germany

"NP" schrieb im Newsbeitrag
...
Looking for a way to find the number that falls closest to

another
number in
Excel ...

Cell A1 contains value 750
Cell A2 contains value 1500
Cell A3 contains value 3000

When I enter a value in cell A5 (e.g. 800), the result I would

like
retuned
in cell B5 is the number from cell a1, a2 or a3 which is closest

to
the
value in A5. Anyone any ideas how to do this please?

Many thanks,

NP.








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
Find closest match and return next highest number in range x6v87qe Excel Discussion (Misc queries) 4 June 18th 08 01:58 PM
How can I match a random number with closest number from sequence? Matt Excel Worksheet Functions 4 August 3rd 06 01:22 AM
Find the closest match to a reference number in a row of unsorted Nick Krill Excel Worksheet Functions 3 January 1st 06 08:33 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
Closest number match help ... NP Excel Worksheet Functions 0 October 28th 04 09:33 AM


All times are GMT +1. The time now is 06:43 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"