Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Closest Match Formula

Let me start with an example of data first...

12 25 2 9 ?

I have 4 columns above. The first three columns are numbers and one of
those needs go into a new column, which would be column 5. In column 5, I
need to know which of the first three columns is the closest match to column
4 without going over. Can a formula be set up like this? This would be in
Excel 2003.

Thanks!
Trisha
  #2   Report Post  
Posted to microsoft.public.excel.misc
CM CM is offline
external usenet poster
 
Posts: 136
Default Closest Match Formula

assuming values are in a1,b1,c1 and d1:

=MAX(IF(A1D1,0,A1),IF(B1D1,0,B1),IF(C1D1,0,C1))

"TJAC" wrote:

Let me start with an example of data first...

12 25 2 9 ?

I have 4 columns above. The first three columns are numbers and one of
those needs go into a new column, which would be column 5. In column 5, I
need to know which of the first three columns is the closest match to column
4 without going over. Can a formula be set up like this? This would be in
Excel 2003.

Thanks!
Trisha

  #3   Report Post  
Posted to microsoft.public.excel.misc
KC KC is offline
external usenet poster
 
Posts: 94
Default Closest Match Formula

what if the data looks like...

12 6 2 9 ?

do you want it to be 12 or 6? because both have difference of 3 from 9?

-kc

"TJAC" wrote:

Let me start with an example of data first...

12 25 2 9 ?

I have 4 columns above. The first three columns are numbers and one of
those needs go into a new column, which would be column 5. In column 5, I
need to know which of the first three columns is the closest match to column
4 without going over. Can a formula be set up like this? This would be in
Excel 2003.

Thanks!
Trisha

  #4   Report Post  
Posted to microsoft.public.excel.misc
KC KC is offline
external usenet poster
 
Posts: 94
Default Closest Match Formula

the below formula gets you the first closest to D1

=IF(ABS(D1-A1)=MIN(ABS(D1-A1),ABS(D1-B1),ABS(D1-C1)),A1,IF(ABS(D1-B1)=MIN(ABS(D1-A1),ABS(D1-B1),ABS(D1-C1)),B1,C1))


-kc
*Click Yes if this helps

"KC" wrote:

what if the data looks like...

12 6 2 9 ?

do you want it to be 12 or 6? because both have difference of 3 from 9?

-kc

"TJAC" wrote:

Let me start with an example of data first...

12 25 2 9 ?

I have 4 columns above. The first three columns are numbers and one of
those needs go into a new column, which would be column 5. In column 5, I
need to know which of the first three columns is the closest match to column
4 without going over. Can a formula be set up like this? This would be in
Excel 2003.

Thanks!
Trisha

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
Help! Find Closest Coordinate Match Bill Excel Discussion (Misc queries) 6 May 2nd 23 07:42 PM
index and match closest Mona Excel Worksheet Functions 3 January 11th 08 03:39 AM
closest match [email protected] Excel Worksheet Functions 4 June 11th 06 02:30 PM
Finding Closest Match andyiain Excel Worksheet Functions 1 March 15th 06 07:24 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 10:17 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"