Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to determine the value - 8 Dec?

Does anyone have any suggestions on how to determine the value?
There are two lists of number under column A and B.
Example 1:
I would like to determine the closest and minimum numbers between A and B

A B
173 173
160 162
156 156
150 152
It should return 156 in cell C1

Example 2:
I would like to determine the closest and maximum numbers between A and B

A B
144 144
133 138
130 134
126 126
It should return 144 in cell C1

Does anyone have any suggestions on how to do it?
Thanks in advance for any suggestions
Eric
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default How to determine the value - 8 Dec?

These array formulas** work based on your limited samples...but...

In your samples column B is always = column A. Is this *always* the case?

Array entered** :

For the MIN:

=MIN(IF(B1:B4-A1:A4=MIN(B1:B4-A1:A4),B1:B4))

For the MAX:

=MAX(IF(B1:B4-A1:A4=MIN(B1:B4-A1:A4),B1:B4))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"Eric" wrote in message
...
Does anyone have any suggestions on how to determine the value?
There are two lists of number under column A and B.
Example 1:
I would like to determine the closest and minimum numbers between A and B

A B
173 173
160 162
156 156
150 152
It should return 156 in cell C1

Example 2:
I would like to determine the closest and maximum numbers between A and B

A B
144 144
133 138
130 134
126 126
It should return 144 in cell C1

Does anyone have any suggestions on how to do it?
Thanks in advance for any suggestions
Eric



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to determine the value - 8 Dec?

Thank you very much for suggestions
For this case, the formula does not work
=MAX(IF(B1:B4-A1:A4=MIN(B1:B4-A1:A4),B1:B4))

A B
54 48
48 42
37 38
34 35
48 should be returned in cell C1
Does anyone have any suggestions?
Thank everyone very much for any suggestion

"T. Valko" wrote:

These array formulas** work based on your limited samples...but...

In your samples column B is always = column A. Is this *always* the case?

Array entered** :

For the MIN:

=MIN(IF(B1:B4-A1:A4=MIN(B1:B4-A1:A4),B1:B4))

For the MAX:

=MAX(IF(B1:B4-A1:A4=MIN(B1:B4-A1:A4),B1:B4))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"Eric" wrote in message
...
Does anyone have any suggestions on how to determine the value?
There are two lists of number under column A and B.
Example 1:
I would like to determine the closest and minimum numbers between A and B

A B
173 173
160 162
156 156
150 152
It should return 156 in cell C1

Example 2:
I would like to determine the closest and maximum numbers between A and B

A B
144 144
133 138
130 134
126 126
It should return 144 in cell C1

Does anyone have any suggestions on how to do it?
Thanks in advance for any suggestions
Eric




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default How to determine the value - 8 Dec?

works fine on my Excel 2003
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to determine the value - 8 Dec?

Thanks everyone very much for suggestions

What if I change A to B, and B to A
=MAX(IF(A1:A4-B1:B4=MIN(A1:A4-B1:B4),A1:A4))
A B
54 48
48 42
37 38
34 35

37 is returned in cell A1, but it should return 48.
Does anyone have suggestions?
Thanks everyone very much for any suggestions
Eric


"Jarek Kujawa" wrote:

works fine on my Excel 2003



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 896
Default How to determine the value - 8 Dec?

yr formula gives required result
=MAX(IF(A1:A4-B1:B4=MIN(A1:A4-B1:B4),A1:A4)) should give 37


one way to achieve what you want is:
=LARGE(IF($A$1:$A$4-$B$1:$B$4=MAX($A$1:$A$4-$B$1:$B$4),$A$1:$A$4),1)
=LARGE(IF($A$1:$A$4-$B$1:$B$4=MAX($A$1:$A$4-$B$1:$B$4),$A$1:$A$4),2)
....
gives 54, 48...
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
How to determine the max. value? Eric Excel Worksheet Functions 4 July 2nd 08 02:46 AM
How to determine the max. value? Eric Excel Worksheet Functions 0 July 1st 08 05:04 PM
How to determine the value? Eric Excel Discussion (Misc queries) 1 July 24th 07 07:14 AM
How to determine the value? Eric Excel Worksheet Functions 1 February 13th 07 04:17 AM
How to Determine 1st, 2nd & 3rd for a PWD Pete n PWD Land Excel Discussion (Misc queries) 3 February 17th 05 09:25 PM


All times are GMT +1. The time now is 04:50 AM.

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

About Us

"It's about Microsoft Excel"