Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 155
Default Conditional comparison of values.

Hi, I'm trying to select the highest value in a column (which I can do with
=MAX), but only if the value in an adjacent column is a negative number e.g.
A B
1 10 18
2 -3 20
3 4 22

Although B3 is the highest value, I want to select B2 as it is the next
highest with a negative value in the equivalent row, A2. Presumably I need
some sort of condition applied to the MAX function ?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Conditional comparison of values.

Try this array formula** :

=MAX(IF(A1:A3<0,B1:B3))

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

--
Biff
Microsoft Excel MVP


"Graham" wrote in message
...
Hi, I'm trying to select the highest value in a column (which I can do
with
=MAX), but only if the value in an adjacent column is a negative number
e.g.
A B
1 10 18
2 -3 20
3 4 22

Although B3 is the highest value, I want to select B2 as it is the next
highest with a negative value in the equivalent row, A2. Presumably I need
some sort of condition applied to the MAX function ?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 155
Default Conditional comparison of values.

Dear Biff
Many thanks for your help, looks to be working OK!! I'll now try to modify
it to create a dynamic range.

=MAX(IF(G38:G56<0,G38:G56))

"T. Valko" wrote:

Try this array formula** :

=MAX(IF(A1:A3<0,B1:B3))

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

--
Biff
Microsoft Excel MVP


"Graham" wrote in message
...
Hi, I'm trying to select the highest value in a column (which I can do
with
=MAX), but only if the value in an adjacent column is a negative number
e.g.
A B
1 10 18
2 -3 20
3 4 22

Although B3 is the highest value, I want to select B2 as it is the next
highest with a negative value in the equivalent row, A2. Presumably I need
some sort of condition applied to the MAX function ?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 155
Default Conditional comparison of values.

Hi, I'm trying to amend the array formula shown in my post below into a
dynamic array formula. I've got as far as the following :

{=MAX(IF(OFFSET(C38,0,0,$A$1-ROW(C38)+1,1)<0,(OFFSET(G38,0,0,$A$1-ROW(G38)+1,1))))}

But I'm getting an error message returned. Can anyone spot where I'm going
wrong ?
Many Thanks


"Graham" wrote:

Dear Biff
Many thanks for your help, looks to be working OK!! I'll now try to modify
it to create a dynamic range.

=MAX(IF(G38:G56<0,G38:G56))

"T. Valko" wrote:

Try this array formula** :

=MAX(IF(A1:A3<0,B1:B3))

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

--
Biff
Microsoft Excel MVP


"Graham" wrote in message
...
Hi, I'm trying to select the highest value in a column (which I can do
with
=MAX), but only if the value in an adjacent column is a negative number
e.g.
A B
1 10 18
2 -3 20
3 4 22

Although B3 is the highest value, I want to select B2 as it is the next
highest with a negative value in the equivalent row, A2. Presumably I need
some sort of condition applied to the MAX function ?




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Conditional comparison of values.

{=MAX(IF(OFFSET(C38,0,0,$A$1-ROW(C38)+1,1)<0,(OFFSET(G38,0,0,$A$1-ROW(G38)+1,1))))}

Assuming there are no empty/blank cells *within* the range.

Array entered:

=MAX(IF(C38:INDEX(C38:C56,COUNT(C38:C56))<0,G38:IN DEX(G38:G56,COUNT(C38:C56))))

But, why use a dynamic range when the entire range is relatively small?


--
Biff
Microsoft Excel MVP


"Graham" wrote in message
...
Hi, I'm trying to amend the array formula shown in my post below into a
dynamic array formula. I've got as far as the following :

{=MAX(IF(OFFSET(C38,0,0,$A$1-ROW(C38)+1,1)<0,(OFFSET(G38,0,0,$A$1-ROW(G38)+1,1))))}

But I'm getting an error message returned. Can anyone spot where I'm going
wrong ?
Many Thanks


"Graham" wrote:

Dear Biff
Many thanks for your help, looks to be working OK!! I'll now try to
modify
it to create a dynamic range.

=MAX(IF(G38:G56<0,G38:G56))

"T. Valko" wrote:

Try this array formula** :

=MAX(IF(A1:A3<0,B1:B3))

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

--
Biff
Microsoft Excel MVP


"Graham" wrote in message
...
Hi, I'm trying to select the highest value in a column (which I can
do
with
=MAX), but only if the value in an adjacent column is a negative
number
e.g.
A B
1 10 18
2 -3 20
3 4 22

Although B3 is the highest value, I want to select B2 as it is the
next
highest with a negative value in the equivalent row, A2. Presumably I
need
some sort of condition applied to the MAX function ?







  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 155
Default Conditional comparison of values.

Dear Biff
Many thanks for your help once again. Although the range is small at
present, a new row will be added daily and I want to process data from the
entire range, the last 10 entries, and the last 5 entries, all to be updated
daily.
I've seen previous posts from yourself on this subject that may also be
useful.
Regards
Graham

"T. Valko" wrote:

{=MAX(IF(OFFSET(C38,0,0,$A$1-ROW(C38)+1,1)<0,(OFFSET(G38,0,0,$A$1-ROW(G38)+1,1))))}


Assuming there are no empty/blank cells *within* the range.

Array entered:

=MAX(IF(C38:INDEX(C38:C56,COUNT(C38:C56))<0,G38:IN DEX(G38:G56,COUNT(C38:C56))))

But, why use a dynamic range when the entire range is relatively small?


--
Biff
Microsoft Excel MVP


"Graham" wrote in message
...
Hi, I'm trying to amend the array formula shown in my post below into a
dynamic array formula. I've got as far as the following :

{=MAX(IF(OFFSET(C38,0,0,$A$1-ROW(C38)+1,1)<0,(OFFSET(G38,0,0,$A$1-ROW(G38)+1,1))))}

But I'm getting an error message returned. Can anyone spot where I'm going
wrong ?
Many Thanks


"Graham" wrote:

Dear Biff
Many thanks for your help, looks to be working OK!! I'll now try to
modify
it to create a dynamic range.

=MAX(IF(G38:G56<0,G38:G56))

"T. Valko" wrote:

Try this array formula** :

=MAX(IF(A1:A3<0,B1:B3))

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

--
Biff
Microsoft Excel MVP


"Graham" wrote in message
...
Hi, I'm trying to select the highest value in a column (which I can
do
with
=MAX), but only if the value in an adjacent column is a negative
number
e.g.
A B
1 10 18
2 -3 20
3 4 22

Although B3 is the highest value, I want to select B2 as it is the
next
highest with a negative value in the equivalent row, A2. Presumably I
need
some sort of condition applied to the MAX function ?






  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Conditional comparison of values.

Ok, I see why you want a dynamic range.

Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Graham" wrote in message
...
Dear Biff
Many thanks for your help once again. Although the range is small at
present, a new row will be added daily and I want to process data from the
entire range, the last 10 entries, and the last 5 entries, all to be
updated
daily.
I've seen previous posts from yourself on this subject that may also be
useful.
Regards
Graham

"T. Valko" wrote:

{=MAX(IF(OFFSET(C38,0,0,$A$1-ROW(C38)+1,1)<0,(OFFSET(G38,0,0,$A$1-ROW(G38)+1,1))))}


Assuming there are no empty/blank cells *within* the range.

Array entered:

=MAX(IF(C38:INDEX(C38:C56,COUNT(C38:C56))<0,G38:IN DEX(G38:G56,COUNT(C38:C56))))

But, why use a dynamic range when the entire range is relatively small?


--
Biff
Microsoft Excel MVP


"Graham" wrote in message
...
Hi, I'm trying to amend the array formula shown in my post below into a
dynamic array formula. I've got as far as the following :

{=MAX(IF(OFFSET(C38,0,0,$A$1-ROW(C38)+1,1)<0,(OFFSET(G38,0,0,$A$1-ROW(G38)+1,1))))}

But I'm getting an error message returned. Can anyone spot where I'm
going
wrong ?
Many Thanks


"Graham" wrote:

Dear Biff
Many thanks for your help, looks to be working OK!! I'll now try to
modify
it to create a dynamic range.

=MAX(IF(G38:G56<0,G38:G56))

"T. Valko" wrote:

Try this array formula** :

=MAX(IF(A1:A3<0,B1:B3))

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

--
Biff
Microsoft Excel MVP


"Graham" wrote in message
...
Hi, I'm trying to select the highest value in a column (which I
can
do
with
=MAX), but only if the value in an adjacent column is a negative
number
e.g.
A B
1 10 18
2 -3 20
3 4 22

Although B3 is the highest value, I want to select B2 as it is the
next
highest with a negative value in the equivalent row, A2.
Presumably I
need
some sort of condition applied to the MAX function ?








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
Baseline values for comparison Carlee Charts and Charting in Excel 3 April 15th 07 08:40 PM
VLOOKUP using another table for comparison values Karen S. Excel Worksheet Functions 3 June 15th 06 09:56 PM
Looking up value that has two comparison values Charlene79 Excel Discussion (Misc queries) 1 June 8th 06 08:56 PM
String Comparison & Conditional Formatting Blobbies Excel Discussion (Misc queries) 3 April 18th 06 07:43 AM
How do I lookup data with two comparison values? Tiziano Excel Worksheet Functions 9 December 3rd 05 05:15 AM


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