I would like to set following conditions in Excel, but find it difficult on
coding.
Could anyone give me any suggestion please?
Under A Colume, there are a list of numbers
Profit
100
101
-50
-60
50
-50
-20
-10
80
Under Colume B, I would like to determine the maximum consecutive loss from
Colume A, in this case, it should return -50-60 = -110
Does anyone have any suggestion?
Thank you in advance
Eric
Hi Eric:
In B2 enter =A1 A2
and copy B2 down thru B9. You should see:
100
101201
-5051
-60-110
50-10
-500
-20-70
-10-30
8070In an un-used cell enter =MIN(B2:B9)
--
Gary's Studentquot;Ericquot; wrote:
gt; I would like to set following conditions in Excel, but find it difficult on
gt; coding.
gt; Could anyone give me any suggestion please?
gt;
gt; Under A Colume, there are a list of numbers
gt; Profit
gt; 100
gt; 101
gt; -50
gt; -60
gt; 50
gt; -50
gt; -20
gt; -10
gt; 80
gt;
gt; Under Colume B, I would like to determine the maximum consecutive loss from
gt; Colume A, in this case, it should return -50-60 = -110
gt;
gt; Does anyone have any suggestion?
gt; Thank you in advance
gt; Eric
Try =MIN(A1:A8 A2:A9) which must be entered as an array formula using
SHIFT CTRL ENTER rather than just ENTER.
The formula will appear like this in Formula Bar: {=MIN(A1:A8 A2:A9)}
Of course, you can change ranges to fit you need: A1:A99 A2:A100
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from emailquot;Ericquot; gt; wrote in message
...
gt;I would like to set following conditions in Excel, but find it difficult on
gt; coding.
gt; Could anyone give me any suggestion please?
gt;
gt; Under A Colume, there are a list of numbers
gt; Profit
gt; 100
gt; 101
gt; -50
gt; -60
gt; 50
gt; -50
gt; -20
gt; -10
gt; 80
gt;
gt; Under Colume B, I would like to determine the maximum consecutive loss
gt; from
gt; Colume A, in this case, it should return -50-60 = -110
gt;
gt; Does anyone have any suggestion?
gt; Thank you in advance
gt; Eric
quot;Ericquot; wrote:
gt; Under A Colume, there are a list of numbers
gt; Profit
gt; 100
gt; 101
gt; -50
gt; -60
gt; 50
gt; -50
gt; -20
gt; -10
gt; 80
gt; Under Colume B, I would like to determine the maximum
gt; consecutive loss from Colume A, in this case, it should
gt; return -50-60 = -110
Clarification needed ....
For the 3 rows starting in the 4th row from the end, do
you want -50-20-10 = -80? And you would want that
to be the quot;maximum consecutive lossquot; if -60 were -20
in the 4th row (so that -50-20 = -70, not -110), right?
In other words, you are not just interested in pairwise
quot;consecutivequot; losses, but consecutive loss sequences of
any length. Is that right?
Thank everyone for suggestion
Yes, I am interested on the consecutive loss sequences of any length, and
return the highest loss for the result.
Thank you
Eric
quot; wrote:
gt; quot;Ericquot; wrote:
gt; gt; Under A Colume, there are a list of numbers
gt; gt; Profit
gt; gt; 100
gt; gt; 101
gt; gt; -50
gt; gt; -60
gt; gt; 50
gt; gt; -50
gt; gt; -20
gt; gt; -10
gt; gt; 80
gt; gt; Under Colume B, I would like to determine the maximum
gt; gt; consecutive loss from Colume A, in this case, it should
gt; gt; return -50-60 = -110
gt;
gt; Clarification needed ....
gt;
gt; For the 3 rows starting in the 4th row from the end, do
gt; you want -50-20-10 = -80? And you would want that
gt; to be the quot;maximum consecutive lossquot; if -60 were -20
gt; in the 4th row (so that -50-20 = -70, not -110), right?
gt;
gt; In other words, you are not just interested in pairwise
gt; quot;consecutivequot; losses, but consecutive loss sequences of
gt; any length. Is that right?
in B2
=IF(ROW()=2,IF(SIGN(A1)lt;gt;SIGN(A2),A2,A1 A2),IF(SIG N(A1)lt;gt;SIGN(A2),A2,A2 B1))
Then select b2 and drag down the column
in C1
=min(B:B)
--
Regards,
Tom Ogilvyquot;Ericquot; gt; wrote in message
...
gt; Thank everyone for suggestion
gt; Yes, I am interested on the consecutive loss sequences of any length, and
gt; return the highest loss for the result.
gt; Thank you
gt; Eric
gt;
gt; quot; wrote:
gt;
gt; gt; quot;Ericquot; wrote:
gt; gt; gt; Under A Colume, there are a list of numbers
gt; gt; gt; Profit
gt; gt; gt; 100
gt; gt; gt; 101
gt; gt; gt; -50
gt; gt; gt; -60
gt; gt; gt; 50
gt; gt; gt; -50
gt; gt; gt; -20
gt; gt; gt; -10
gt; gt; gt; 80
gt; gt; gt; Under Colume B, I would like to determine the maximum
gt; gt; gt; consecutive loss from Colume A, in this case, it should
gt; gt; gt; return -50-60 = -110
gt; gt;
gt; gt; Clarification needed ....
gt; gt;
gt; gt; For the 3 rows starting in the 4th row from the end, do
gt; gt; you want -50-20-10 = -80? And you would want that
gt; gt; to be the quot;maximum consecutive lossquot; if -60 were -20
gt; gt; in the 4th row (so that -50-20 = -70, not -110), right?
gt; gt;
gt; gt; In other words, you are not just interested in pairwise
gt; gt; quot;consecutivequot; losses, but consecutive loss sequences of
gt; gt; any length. Is that right?
- Aug 28 Tue 2007 20:38
How to determine following function in Excel?
close
全站熱搜
留言列表
發表留言