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...
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default How to determine the value - 8 Dec?

I try to re-word my statement
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 152
160 156
156 173
150 162
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 134
133 126
130 144
126 138
It should return 144 in cell C1

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

"Jarek Kujawa" wrote:

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...

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

I would like to determine the closest and
maximum numbers between A and B
A B
144 134
133 126
130 144
126 138
It should return 144 in cell C1


The closest range is 133 126 and the max value of that range is 133.

Try these array formulas** :

For the MAX:

=MAX(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

For the MIN:

=MIN(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

** 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
...
I try to re-word my statement
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 152
160 156
156 173
150 162
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 134
133 126
130 144
126 138
It should return 144 in cell C1

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

"Jarek Kujawa" wrote:

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...



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

Hmmm...

I just thought of something...

150...160
170...160

Both of those have the same range. The formulas I posted will find the
*first* instance of the closest range. If it's possible to have more than 1
instance of the same range let me/us know.

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
I would like to determine the closest and
maximum numbers between A and B
A B
144 134
133 126
130 144
126 138
It should return 144 in cell C1


The closest range is 133 126 and the max value of that range is 133.

Try these array formulas** :

For the MAX:

=MAX(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

For the MIN:

=MIN(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

** 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
...
I try to re-word my statement
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 152
160 156
156 173
150 162
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 134
133 126
130 144
126 138
It should return 144 in cell C1

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

"Jarek Kujawa" wrote:

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...





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

I try to re-word my description
In cell A1, there is 144. I would like to find the closest values within the
range in col B, then return the different 0 in cell C1
In cell A2, there is 133. I would like to find the closest values within the
range in col B, then return the different 1 in cell C2
In cell A3, there is 130. I would like to find the closest values within the
range in col B, then return the different 4 in cell C3
In cell A4, there is 126. I would like to find the closest values within the
range in col B, then return the different 0 in cell C4
After that, I would like to find the minimum value under column C and return
the maximum value 0 under column A 144.

Does anyone have any suggestions?
Thanks everyone very much for any suggestions
Eric

"T. Valko" wrote:

I would like to determine the closest and
maximum numbers between A and B
A B
144 134
133 126
130 144
126 138
It should return 144 in cell C1


The closest range is 133 126 and the max value of that range is 133.

Try these array formulas** :

For the MAX:

=MAX(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

For the MIN:

=MIN(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

** 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
...
I try to re-word my statement
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 152
160 156
156 173
150 162
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 134
133 126
130 144
126 138
It should return 144 in cell C1

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

"Jarek Kujawa" wrote:

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...






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

Sorry, I don't understand.

--
Biff
Microsoft Excel MVP


"Eric" wrote in message
...
I try to re-word my description
In cell A1, there is 144. I would like to find the closest values within
the
range in col B, then return the different 0 in cell C1
In cell A2, there is 133. I would like to find the closest values within
the
range in col B, then return the different 1 in cell C2
In cell A3, there is 130. I would like to find the closest values within
the
range in col B, then return the different 4 in cell C3
In cell A4, there is 126. I would like to find the closest values within
the
range in col B, then return the different 0 in cell C4
After that, I would like to find the minimum value under column C and
return
the maximum value 0 under column A 144.

Does anyone have any suggestions?
Thanks everyone very much for any suggestions
Eric

"T. Valko" wrote:

I would like to determine the closest and
maximum numbers between A and B
A B
144 134
133 126
130 144
126 138
It should return 144 in cell C1


The closest range is 133 126 and the max value of that range is 133.

Try these array formulas** :

For the MAX:

=MAX(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

For the MIN:

=MIN(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

** 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
...
I try to re-word my statement
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 152
160 156
156 173
150 162
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 134
133 126
130 144
126 138
It should return 144 in cell C1

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

"Jarek Kujawa" wrote:

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...






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

I try to re-word my description.
Let assume all numbers within the same column A
144, 133, 130, 126, 134, 126, 144, 138

I would like to determine the closest and maximum numbers by comparing one
by one.

In cell A1, there is 144. I would like to find the closest values within the
rest numbers, then return the different 0 in cell C1, because there is
another 144.
In cell A2, there is 133. I would like to find the closest values within the
rest numbers, then return the different 1 in cell C2 by comparing with the
number 134.
In cell A3, there is 130. I would like to find the closest values within the
rest numbers, then return the different 3 in cell C3 by comparing with the
number 133.
In cell A4, there is 126. I would like to find the closest values within the
rest numbers, then return the different 0 in cell C4, because there is
another 126.
In cell A5, there is 134. I would like to find the closest values within the
rest numbers, then return the different 1 in cell C5 by comparing with the
number 133.
In cell A6, there is 126. I would like to find the closest values within the
rest numbers, then return the different 0 in cell C6, because there is
another 126.
In cell A7, there is 144. I would like to find the closest values within the
rest numbers, then return the different 0 in cell C7, because there is
another 144.
In cell A8, there is 138. I would like to find the closest values within the
rest numbers, then return the different 4 in cell C8 by comparing with the
number 134.

After that, I would like to find the maximum value under column A by
matching the minimum value under column C and it would return 144,
because there are 4 numbers having 0 under column C, 144, 126, 126, 144.
The maximum value for this result is 144.

Does anyone have any suggestions?
Thanks everyone very much for any suggestions
Eric


"T. Valko" wrote:

Sorry, I don't understand.

--
Biff
Microsoft Excel MVP


"Eric" wrote in message
...
I try to re-word my description
In cell A1, there is 144. I would like to find the closest values within
the
range in col B, then return the different 0 in cell C1
In cell A2, there is 133. I would like to find the closest values within
the
range in col B, then return the different 1 in cell C2
In cell A3, there is 130. I would like to find the closest values within
the
range in col B, then return the different 4 in cell C3
In cell A4, there is 126. I would like to find the closest values within
the
range in col B, then return the different 0 in cell C4
After that, I would like to find the minimum value under column C and
return
the maximum value 0 under column A 144.

Does anyone have any suggestions?
Thanks everyone very much for any suggestions
Eric

"T. Valko" wrote:

I would like to determine the closest and
maximum numbers between A and B
A B
144 134
133 126
130 144
126 138
It should return 144 in cell C1

The closest range is 133 126 and the max value of that range is 133.

Try these array formulas** :

For the MAX:

=MAX(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

For the MIN:

=MIN(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

** 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
...
I try to re-word my statement
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 152
160 156
156 173
150 162
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 134
133 126
130 144
126 138
It should return 144 in cell C1

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

"Jarek Kujawa" wrote:

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...







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

Ok, I think we got it this time!

Enter this array formula** in B1 and copy down to B8:

=IF(COUNTIF(A$1:A$8,A1)1,0,MIN(ABS(A1-IF(A$1:A$8<A1,A$1:A$8,100000))))

Enter this array formula** in C1:

=MAX(IF(B1:B8=MIN(B1:B8),A1:A8))

** 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
...
I try to re-word my description.
Let assume all numbers within the same column A
144, 133, 130, 126, 134, 126, 144, 138

I would like to determine the closest and maximum numbers by comparing one
by one.

In cell A1, there is 144. I would like to find the closest values within
the
rest numbers, then return the different 0 in cell C1, because there is
another 144.
In cell A2, there is 133. I would like to find the closest values within
the
rest numbers, then return the different 1 in cell C2 by comparing with the
number 134.
In cell A3, there is 130. I would like to find the closest values within
the
rest numbers, then return the different 3 in cell C3 by comparing with the
number 133.
In cell A4, there is 126. I would like to find the closest values within
the
rest numbers, then return the different 0 in cell C4, because there is
another 126.
In cell A5, there is 134. I would like to find the closest values within
the
rest numbers, then return the different 1 in cell C5 by comparing with the
number 133.
In cell A6, there is 126. I would like to find the closest values within
the
rest numbers, then return the different 0 in cell C6, because there is
another 126.
In cell A7, there is 144. I would like to find the closest values within
the
rest numbers, then return the different 0 in cell C7, because there is
another 144.
In cell A8, there is 138. I would like to find the closest values within
the
rest numbers, then return the different 4 in cell C8 by comparing with the
number 134.

After that, I would like to find the maximum value under column A by
matching the minimum value under column C and it would return 144,
because there are 4 numbers having 0 under column C, 144, 126, 126, 144.
The maximum value for this result is 144.

Does anyone have any suggestions?
Thanks everyone very much for any suggestions
Eric


"T. Valko" wrote:

Sorry, I don't understand.

--
Biff
Microsoft Excel MVP


"Eric" wrote in message
...
I try to re-word my description
In cell A1, there is 144. I would like to find the closest values
within
the
range in col B, then return the different 0 in cell C1
In cell A2, there is 133. I would like to find the closest values
within
the
range in col B, then return the different 1 in cell C2
In cell A3, there is 130. I would like to find the closest values
within
the
range in col B, then return the different 4 in cell C3
In cell A4, there is 126. I would like to find the closest values
within
the
range in col B, then return the different 0 in cell C4
After that, I would like to find the minimum value under column C and
return
the maximum value 0 under column A 144.

Does anyone have any suggestions?
Thanks everyone very much for any suggestions
Eric

"T. Valko" wrote:

I would like to determine the closest and
maximum numbers between A and B
A B
144 134
133 126
130 144
126 138
It should return 144 in cell C1

The closest range is 133 126 and the max value of that range is 133.

Try these array formulas** :

For the MAX:

=MAX(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

For the MIN:

=MIN(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

** 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
...
I try to re-word my statement
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 152
160 156
156 173
150 162
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 134
133 126
130 144
126 138
It should return 144 in cell C1

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

"Jarek Kujawa" wrote:

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...









  #14   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
Eric

"T. Valko" wrote:

Ok, I think we got it this time!

Enter this array formula** in B1 and copy down to B8:

=IF(COUNTIF(A$1:A$8,A1)1,0,MIN(ABS(A1-IF(A$1:A$8<A1,A$1:A$8,100000))))

Enter this array formula** in C1:

=MAX(IF(B1:B8=MIN(B1:B8),A1:A8))

** 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
...
I try to re-word my description.
Let assume all numbers within the same column A
144, 133, 130, 126, 134, 126, 144, 138

I would like to determine the closest and maximum numbers by comparing one
by one.

In cell A1, there is 144. I would like to find the closest values within
the
rest numbers, then return the different 0 in cell C1, because there is
another 144.
In cell A2, there is 133. I would like to find the closest values within
the
rest numbers, then return the different 1 in cell C2 by comparing with the
number 134.
In cell A3, there is 130. I would like to find the closest values within
the
rest numbers, then return the different 3 in cell C3 by comparing with the
number 133.
In cell A4, there is 126. I would like to find the closest values within
the
rest numbers, then return the different 0 in cell C4, because there is
another 126.
In cell A5, there is 134. I would like to find the closest values within
the
rest numbers, then return the different 1 in cell C5 by comparing with the
number 133.
In cell A6, there is 126. I would like to find the closest values within
the
rest numbers, then return the different 0 in cell C6, because there is
another 126.
In cell A7, there is 144. I would like to find the closest values within
the
rest numbers, then return the different 0 in cell C7, because there is
another 144.
In cell A8, there is 138. I would like to find the closest values within
the
rest numbers, then return the different 4 in cell C8 by comparing with the
number 134.

After that, I would like to find the maximum value under column A by
matching the minimum value under column C and it would return 144,
because there are 4 numbers having 0 under column C, 144, 126, 126, 144.
The maximum value for this result is 144.

Does anyone have any suggestions?
Thanks everyone very much for any suggestions
Eric


"T. Valko" wrote:

Sorry, I don't understand.

--
Biff
Microsoft Excel MVP


"Eric" wrote in message
...
I try to re-word my description
In cell A1, there is 144. I would like to find the closest values
within
the
range in col B, then return the different 0 in cell C1
In cell A2, there is 133. I would like to find the closest values
within
the
range in col B, then return the different 1 in cell C2
In cell A3, there is 130. I would like to find the closest values
within
the
range in col B, then return the different 4 in cell C3
In cell A4, there is 126. I would like to find the closest values
within
the
range in col B, then return the different 0 in cell C4
After that, I would like to find the minimum value under column C and
return
the maximum value 0 under column A 144.

Does anyone have any suggestions?
Thanks everyone very much for any suggestions
Eric

"T. Valko" wrote:

I would like to determine the closest and
maximum numbers between A and B
A B
144 134
133 126
130 144
126 138
It should return 144 in cell C1

The closest range is 133 126 and the max value of that range is 133.

Try these array formulas** :

For the MAX:

=MAX(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

For the MIN:

=MIN(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

** 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
...
I try to re-word my statement
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 152
160 156
156 173
150 162
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 134
133 126
130 144
126 138
It should return 144 in cell C1

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

"Jarek Kujawa" wrote:

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...










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

You're welcome!

--
Biff
Microsoft Excel MVP


"Eric" wrote in message
...
Thanks everyone very much for suggestions
Eric

"T. Valko" wrote:

Ok, I think we got it this time!

Enter this array formula** in B1 and copy down to B8:

=IF(COUNTIF(A$1:A$8,A1)1,0,MIN(ABS(A1-IF(A$1:A$8<A1,A$1:A$8,100000))))

Enter this array formula** in C1:

=MAX(IF(B1:B8=MIN(B1:B8),A1:A8))

** 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
...
I try to re-word my description.
Let assume all numbers within the same column A
144, 133, 130, 126, 134, 126, 144, 138

I would like to determine the closest and maximum numbers by comparing
one
by one.

In cell A1, there is 144. I would like to find the closest values
within
the
rest numbers, then return the different 0 in cell C1, because there is
another 144.
In cell A2, there is 133. I would like to find the closest values
within
the
rest numbers, then return the different 1 in cell C2 by comparing with
the
number 134.
In cell A3, there is 130. I would like to find the closest values
within
the
rest numbers, then return the different 3 in cell C3 by comparing with
the
number 133.
In cell A4, there is 126. I would like to find the closest values
within
the
rest numbers, then return the different 0 in cell C4, because there is
another 126.
In cell A5, there is 134. I would like to find the closest values
within
the
rest numbers, then return the different 1 in cell C5 by comparing with
the
number 133.
In cell A6, there is 126. I would like to find the closest values
within
the
rest numbers, then return the different 0 in cell C6, because there is
another 126.
In cell A7, there is 144. I would like to find the closest values
within
the
rest numbers, then return the different 0 in cell C7, because there is
another 144.
In cell A8, there is 138. I would like to find the closest values
within
the
rest numbers, then return the different 4 in cell C8 by comparing with
the
number 134.

After that, I would like to find the maximum value under column A by
matching the minimum value under column C and it would return 144,
because there are 4 numbers having 0 under column C, 144, 126, 126,
144.
The maximum value for this result is 144.

Does anyone have any suggestions?
Thanks everyone very much for any suggestions
Eric


"T. Valko" wrote:

Sorry, I don't understand.

--
Biff
Microsoft Excel MVP


"Eric" wrote in message
...
I try to re-word my description
In cell A1, there is 144. I would like to find the closest values
within
the
range in col B, then return the different 0 in cell C1
In cell A2, there is 133. I would like to find the closest values
within
the
range in col B, then return the different 1 in cell C2
In cell A3, there is 130. I would like to find the closest values
within
the
range in col B, then return the different 4 in cell C3
In cell A4, there is 126. I would like to find the closest values
within
the
range in col B, then return the different 0 in cell C4
After that, I would like to find the minimum value under column C
and
return
the maximum value 0 under column A 144.

Does anyone have any suggestions?
Thanks everyone very much for any suggestions
Eric

"T. Valko" wrote:

I would like to determine the closest and
maximum numbers between A and B
A B
144 134
133 126
130 144
126 138
It should return 144 in cell C1

The closest range is 133 126 and the max value of that range is
133.

Try these array formulas** :

For the MAX:

=MAX(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

For the MIN:

=MIN(INDEX(A2:B5,MATCH(TRUE,ABS(A2:A5-B2:B5)=MIN(ABS(A2:A5-B2:B5)),0),0))

** 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
...
I try to re-word my statement
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 152
160 156
156 173
150 162
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 134
133 126
130 144
126 138
It should return 144 in cell C1

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

"Jarek Kujawa" wrote:

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 12:58 PM.

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"