A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

I Need a formula to evaluate a cell with + or - values



 
 
Thread Tools Display Modes
  #1  
Old October 28th, 2005, 08:09 PM
Bob in Oklahoma
external usenet poster
 
Posts: n/a
Default I Need a formula to evaluate a cell with + or - values

The formula in Cell A1 evaluates the values in B1, C1, and D1. B1 can be
blank or have numerical values either positive or negative. C1 always has
numerical values but can be positive or negative. D1 is either blank or has
a text value of "Final". The value of A1 changes based on the condition of
B1 & D1. There are four possible conditions for B1; Blank, 0, positive value,
or negative value. Here is the formula that I have which works as long as
the values in B1 & C1 are both positive.
=IF(B1="",IF(B1C1,B1,C1),IF(B1=0,0,IF(D1="Final", B1,IF(B1C1,B1,C1))))
The problem seems to be with the last step of the formula IF(B1C1,B1,C1 ...
for a negative condition in both B1 and C1 the formula has to be
IF(B1C1,B1,C1. And then there is the possibility of positive condition in
one cell or the other with a negative value in the opposite cell. Is there
another operator that I can use that elaluates B1 & C1 for a positive or
negative condition and changes the value in A1 as follows;
IF(B1="",C1, --- changes the value in A1 to the value in C1 if B1 is
blank
IF(B1=0,0, --- changes the value in A1 to the value in B1 if B1 is 0
IF(D1="Final",B1 --- changes the value in A1 to the value in B1 if D1 is
"Final"
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have positive values
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have negative values
  #2  
Old October 28th, 2005, 08:44 PM
Ron Rosenfeld
external usenet poster
 
Posts: n/a
Default I Need a formula to evaluate a cell with + or - values

On Fri, 28 Oct 2005 12:09:06 -0700, Bob in Oklahoma Bob in
wrote:

The formula in Cell A1 evaluates the values in B1, C1, and D1. B1 can be
blank or have numerical values either positive or negative. C1 always has
numerical values but can be positive or negative. D1 is either blank or has
a text value of "Final". The value of A1 changes based on the condition of
B1 & D1. There are four possible conditions for B1; Blank, 0, positive value,
or negative value. Here is the formula that I have which works as long as
the values in B1 & C1 are both positive.
=IF(B1="",IF(B1C1,B1,C1),IF(B1=0,0,IF(D1="Final" ,B1,IF(B1C1,B1,C1))))
The problem seems to be with the last step of the formula IF(B1C1,B1,C1 ...
for a negative condition in both B1 and C1 the formula has to be
IF(B1C1,B1,C1. And then there is the possibility of positive condition in
one cell or the other with a negative value in the opposite cell. Is there
another operator that I can use that elaluates B1 & C1 for a positive or
negative condition and changes the value in A1 as follows;
IF(B1="",C1, --- changes the value in A1 to the value in C1 if B1 is
blank
IF(B1=0,0, --- changes the value in A1 to the value in B1 if B1 is 0
IF(D1="Final",B1 --- changes the value in A1 to the value in B1 if D1 is
"Final"
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have positive values
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have negative values


Your specifications are not clear. There are conflicts. That may be
contributing to your coding difficulties.

For example

1. If B1 is blank and D1="Final", should A1 display C1 or B1 or something
else?
2. What should be displayed if B1 is positive and C1 is negative?
3. In Excelspeak, BLANK means EMPTY. Is that what you mean, also? Or is
there some formula there?

As you write your description, your formula could be:

=IF(AND(D1="Final",ISBLANK(B1)),"undefined",
IF(ISBLANK(B1),C1,
IF(OR(B1=0,D1="Final",SIGN(B1)=SIGN(C1)),B1,
IF(SIGN(B1)SIGN(C1),"undefined"))))

But I think you need to further clarify your logic. Perhaps this formula will
help.
--ron
  #3  
Old October 29th, 2005, 04:22 AM
Bob in Oklahoma
external usenet poster
 
Posts: n/a
Default I Need a formula to evaluate a cell with + or - values



"Ron Rosenfeld" wrote:

On Fri, 28 Oct 2005 12:09:06 -0700, Bob in Oklahoma Bob in
wrote:

The formula in Cell A1 evaluates the values in B1, C1, and D1. B1 can be
blank or have numerical values either positive or negative. C1 always has
numerical values but can be positive or negative. D1 is either blank or has
a text value of "Final". The value of A1 changes based on the condition of
B1 & D1. There are four possible conditions for B1; Blank, 0, positive value,
or negative value. Here is the formula that I have which works as long as
the values in B1 & C1 are both positive.
=IF(B1="",IF(B1C1,B1,C1),IF(B1=0,0,IF(D1="Final" ,B1,IF(B1C1,B1,C1))))
The problem seems to be with the last step of the formula IF(B1C1,B1,C1 ...
for a negative condition in both B1 and C1 the formula has to be
IF(B1C1,B1,C1. And then there is the possibility of positive condition in
one cell or the other with a negative value in the opposite cell. Is there
another operator that I can use that elaluates B1 & C1 for a positive or
negative condition and changes the value in A1 as follows;
IF(B1="",C1, --- changes the value in A1 to the value in C1 if B1 is
blank
IF(B1=0,0, --- changes the value in A1 to the value in B1 if B1 is 0
IF(D1="Final",B1 --- changes the value in A1 to the value in B1 if D1 is
"Final"
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have positive values
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have negative values


Your specifications are not clear. There are conflicts. That may be
contributing to your coding difficulties.

For example

1. If B1 is blank and D1="Final", should A1 display C1 or B1 or something
else?
2. What should be displayed if B1 is positive and C1 is negative?
3. In Excelspeak, BLANK means EMPTY. Is that what you mean, also? Or is
there some formula there?

As you write your description, your formula could be:

=IF(AND(D1="Final",ISBLANK(B1)),"undefined",
IF(ISBLANK(B1),C1,
IF(OR(B1=0,D1="Final",SIGN(B1)=SIGN(C1)),B1,
IF(SIGN(B1)SIGN(C1),"undefined"))))

But I think you need to further clarify your logic. Perhaps this formula will
help.
--ron

OK ... here it is.

The value of A1 is conditioned on the value of B1, C1, & D1. It is never
manually changed.

A1 is a numeric cell. There are 3 possibilities for the value in A1; 0,
positive number, negative number. Never Blank (empty).

B1 is a numeric cell. There are 4 possibilities for the value in B1; Blank
(empty), 0, positive number, negative number. B1 always starts with a Blank
(empty) value.

C1 is a numeric cell. There are 3 possibilities for the value in C1; 0,
positive number, negative number. Never Blank (empty). Usually the value in
C1 does not change after the start value is input. C1 is never updated by
changes to A1, B1.

* D1 is a text cell. There are 2 possibilities for the value in D1;
“Final”, Blank (empty). D1 always starts with a Blank (empty) value. The
value is never changed to “Final” if B1 is Blank (empty). D1 is never
updated by changes to A1, B1, C1.

The logic goes like this:

Since B1and D1 are Blank at the start, then A1 should be the same value as C1.

If I change B1 to 0 then A1 should change to 0; C1 & D1 do not change.

* The following assumes that B1 is not Blank (empty) hence the statement
above. If I change D1 to “Final”, A1 should change to the same value as B1.

If C1 is a positive value and I change B1 to a positive value;
A1 should not change if B1 is smaller than C1, but A1 should change to the
value of B1 if B1 is larger than C1.
Example: A1=100, B1=Blank, C1=100. I change B1 to 50 and A1 does not change
but if I change B1 to 150 then A1 changes to 150.

IF C1 is a negative value and I change B1 to a negative value;
A1 should not change if B1 is a smaller or lesser negative value than C1,
but should change to the same value of B1 if B1 is a greater or larger
negative value than C1. Example: A1=-100, B1=Blank, C1=-100. I change B1 to
-50 and A1 does not change but if I change B1 to -150 then A1 changes to -150.

IF C1 is a positive value and I change B1 to a negative value;
A1 should change to the same negative value as B1.

If C1 is a negative value and I change B1 to a positive value;
A1 should change to the same positive value as B1.

  #4  
Old October 29th, 2005, 01:15 PM
Ron Rosenfeld
external usenet poster
 
Posts: n/a
Default I Need a formula to evaluate a cell with + or - values

On Fri, 28 Oct 2005 20:22:01 -0700, Bob in Oklahoma
wrote:



"Ron Rosenfeld" wrote:

On Fri, 28 Oct 2005 12:09:06 -0700, Bob in Oklahoma Bob in
wrote:

The formula in Cell A1 evaluates the values in B1, C1, and D1. B1 can be
blank or have numerical values either positive or negative. C1 always has
numerical values but can be positive or negative. D1 is either blank or has
a text value of "Final". The value of A1 changes based on the condition of
B1 & D1. There are four possible conditions for B1; Blank, 0, positive value,
or negative value. Here is the formula that I have which works as long as
the values in B1 & C1 are both positive.
=IF(B1="",IF(B1C1,B1,C1),IF(B1=0,0,IF(D1="Final" ,B1,IF(B1C1,B1,C1))))
The problem seems to be with the last step of the formula IF(B1C1,B1,C1 ...
for a negative condition in both B1 and C1 the formula has to be
IF(B1C1,B1,C1. And then there is the possibility of positive condition in
one cell or the other with a negative value in the opposite cell. Is there
another operator that I can use that elaluates B1 & C1 for a positive or
negative condition and changes the value in A1 as follows;
IF(B1="",C1, --- changes the value in A1 to the value in C1 if B1 is
blank
IF(B1=0,0, --- changes the value in A1 to the value in B1 if B1 is 0
IF(D1="Final",B1 --- changes the value in A1 to the value in B1 if D1 is
"Final"
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have positive values
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have negative values


Your specifications are not clear. There are conflicts. That may be
contributing to your coding difficulties.

For example

1. If B1 is blank and D1="Final", should A1 display C1 or B1 or something
else?
2. What should be displayed if B1 is positive and C1 is negative?
3. In Excelspeak, BLANK means EMPTY. Is that what you mean, also? Or is
there some formula there?

As you write your description, your formula could be:

=IF(AND(D1="Final",ISBLANK(B1)),"undefined",
IF(ISBLANK(B1),C1,
IF(OR(B1=0,D1="Final",SIGN(B1)=SIGN(C1)),B1,
IF(SIGN(B1)SIGN(C1),"undefined"))))

But I think you need to further clarify your logic. Perhaps this formula will
help.
--ron

OK ... here it is.

The value of A1 is conditioned on the value of B1, C1, & D1. It is never
manually changed.

A1 is a numeric cell. There are 3 possibilities for the value in A1; 0,
positive number, negative number. Never Blank (empty).

B1 is a numeric cell. There are 4 possibilities for the value in B1; Blank
(empty), 0, positive number, negative number. B1 always starts with a Blank
(empty) value.

C1 is a numeric cell. There are 3 possibilities for the value in C1; 0,
positive number, negative number. Never Blank (empty). Usually the value in
C1 does not change after the start value is input. C1 is never updated by
changes to A1, B1.

* D1 is a text cell. There are 2 possibilities for the value in D1;
Final, Blank (empty). D1 always starts with a Blank (empty) value. The
value is never changed to Final if B1 is Blank (empty). D1 is never
updated by changes to A1, B1, C1.

The logic goes like this:

Since B1and D1 are Blank at the start, then A1 should be the same value as C1.

If I change B1 to 0 then A1 should change to 0; C1 & D1 do not change.

* The following assumes that B1 is not Blank (empty) hence the statement
above. If I change D1 to Final, A1 should change to the same value as B1.

If C1 is a positive value and I change B1 to a positive value;
A1 should not change if B1 is smaller than C1, but A1 should change to the
value of B1 if B1 is larger than C1.
Example: A1=100, B1=Blank, C1=100. I change B1 to 50 and A1 does not change
but if I change B1 to 150 then A1 changes to 150.

IF C1 is a negative value and I change B1 to a negative value;
A1 should not change if B1 is a smaller or lesser negative value than C1,
but should change to the same value of B1 if B1 is a greater or larger
negative value than C1. Example: A1=-100, B1=Blank, C1=-100. I change B1 to
-50 and A1 does not change but if I change B1 to -150 then A1 changes to -150.

IF C1 is a positive value and I change B1 to a negative value;
A1 should change to the same negative value as B1.

If C1 is a negative value and I change B1 to a positive value;
A1 should change to the same positive value as B1.



Try this:

=IF(D1="Final",B1,
IF(ISBLANK(B1),C1,
IF(OR(B1=0,D1="Final",SIGN(B1)=SIGN(C1)),
MAX(ABS(B1),ABS(C1))*SIGN(B1),
IF(SIGN(B1)SIGN(C1),B1))))


--ron
  #5  
Old October 31st, 2005, 01:49 AM
Bob in Oklahoma
external usenet poster
 
Posts: n/a
Default I Need a formula to evaluate a cell with + or - values

You rock Ron, Thanks!
I don't understand the mechanics but it works and I'm greatful. I'll be a
long time trying to learn how it works.

"Ron Rosenfeld" wrote:

On Fri, 28 Oct 2005 20:22:01 -0700, Bob in Oklahoma
wrote:



"Ron Rosenfeld" wrote:

On Fri, 28 Oct 2005 12:09:06 -0700, Bob in Oklahoma Bob in
wrote:

The formula in Cell A1 evaluates the values in B1, C1, and D1. B1 can be
blank or have numerical values either positive or negative. C1 always has
numerical values but can be positive or negative. D1 is either blank or has
a text value of "Final". The value of A1 changes based on the condition of
B1 & D1. There are four possible conditions for B1; Blank, 0, positive value,
or negative value. Here is the formula that I have which works as long as
the values in B1 & C1 are both positive.
=IF(B1="",IF(B1C1,B1,C1),IF(B1=0,0,IF(D1="Final" ,B1,IF(B1C1,B1,C1))))
The problem seems to be with the last step of the formula IF(B1C1,B1,C1 ...
for a negative condition in both B1 and C1 the formula has to be
IF(B1C1,B1,C1. And then there is the possibility of positive condition in
one cell or the other with a negative value in the opposite cell. Is there
another operator that I can use that elaluates B1 & C1 for a positive or
negative condition and changes the value in A1 as follows;
IF(B1="",C1, --- changes the value in A1 to the value in C1 if B1 is
blank
IF(B1=0,0, --- changes the value in A1 to the value in B1 if B1 is 0
IF(D1="Final",B1 --- changes the value in A1 to the value in B1 if D1 is
"Final"
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have positive values
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have negative values

Your specifications are not clear. There are conflicts. That may be
contributing to your coding difficulties.

For example

1. If B1 is blank and D1="Final", should A1 display C1 or B1 or something
else?
2. What should be displayed if B1 is positive and C1 is negative?
3. In Excelspeak, BLANK means EMPTY. Is that what you mean, also? Or is
there some formula there?

As you write your description, your formula could be:

=IF(AND(D1="Final",ISBLANK(B1)),"undefined",
IF(ISBLANK(B1),C1,
IF(OR(B1=0,D1="Final",SIGN(B1)=SIGN(C1)),B1,
IF(SIGN(B1)SIGN(C1),"undefined"))))

But I think you need to further clarify your logic. Perhaps this formula will
help.
--ron

OK ... here it is.

The value of A1 is conditioned on the value of B1, C1, & D1. It is never
manually changed.

A1 is a numeric cell. There are 3 possibilities for the value in A1; 0,
positive number, negative number. Never Blank (empty).

B1 is a numeric cell. There are 4 possibilities for the value in B1; Blank
(empty), 0, positive number, negative number. B1 always starts with a Blank
(empty) value.

C1 is a numeric cell. There are 3 possibilities for the value in C1; 0,
positive number, negative number. Never Blank (empty). Usually the value in
C1 does not change after the start value is input. C1 is never updated by
changes to A1, B1.

* D1 is a text cell. There are 2 possibilities for the value in D1;
“Final”, Blank (empty). D1 always starts with a Blank (empty) value. The
value is never changed to “Final” if B1 is Blank (empty). D1 is never
updated by changes to A1, B1, C1.

The logic goes like this:

Since B1and D1 are Blank at the start, then A1 should be the same value as C1.

If I change B1 to 0 then A1 should change to 0; C1 & D1 do not change.

* The following assumes that B1 is not Blank (empty) hence the statement
above. If I change D1 to “Final”, A1 should change to the same value as B1.

If C1 is a positive value and I change B1 to a positive value;
A1 should not change if B1 is smaller than C1, but A1 should change to the
value of B1 if B1 is larger than C1.
Example: A1=100, B1=Blank, C1=100. I change B1 to 50 and A1 does not change
but if I change B1 to 150 then A1 changes to 150.

IF C1 is a negative value and I change B1 to a negative value;
A1 should not change if B1 is a smaller or lesser negative value than C1,
but should change to the same value of B1 if B1 is a greater or larger
negative value than C1. Example: A1=-100, B1=Blank, C1=-100. I change B1 to
-50 and A1 does not change but if I change B1 to -150 then A1 changes to -150.

IF C1 is a positive value and I change B1 to a negative value;
A1 should change to the same negative value as B1.

If C1 is a negative value and I change B1 to a positive value;
A1 should change to the same positive value as B1.



Try this:

=IF(D1="Final",B1,
IF(ISBLANK(B1),C1,
IF(OR(B1=0,D1="Final",SIGN(B1)=SIGN(C1)),
MAX(ABS(B1),ABS(C1))*SIGN(B1),
IF(SIGN(B1)SIGN(C1),B1))))


--ron

  #6  
Old October 31st, 2005, 03:05 AM
Ron Rosenfeld
external usenet poster
 
Posts: n/a
Default I Need a formula to evaluate a cell with + or - values

Glad it works for you. Thanks for the feedback.

You should be able to tease out the meaning by looking at it line by line, and
comparing it to what you specified.

SIGN is a function that returns -1 if the number is negative, and +1 if the
number is positive (and 0 if the number is 0).

ABS returns the positive value of any number; so both -15 and +15 would return
+15.

=IF(D1="Final",B1,
IF(ISBLANK(B1),C1,
IF(OR(B1=0,D1="Final",SIGN(B1)=SIGN(C1)),
MAX(ABS(B1),ABS(C1))*SIGN(B1),
IF(SIGN(B1)SIGN(C1),B1))))



On Sun, 30 Oct 2005 17:49:02 -0800, Bob in Oklahoma
wrote:

You rock Ron, Thanks!
I don't understand the mechanics but it works and I'm greatful. I'll be a
long time trying to learn how it works.

"Ron Rosenfeld" wrote:

On Fri, 28 Oct 2005 20:22:01 -0700, Bob in Oklahoma
wrote:



"Ron Rosenfeld" wrote:

On Fri, 28 Oct 2005 12:09:06 -0700, Bob in Oklahoma Bob in
wrote:

The formula in Cell A1 evaluates the values in B1, C1, and D1. B1 can be
blank or have numerical values either positive or negative. C1 always has
numerical values but can be positive or negative. D1 is either blank or has
a text value of "Final". The value of A1 changes based on the condition of
B1 & D1. There are four possible conditions for B1; Blank, 0, positive value,
or negative value. Here is the formula that I have which works as long as
the values in B1 & C1 are both positive.
=IF(B1="",IF(B1C1,B1,C1),IF(B1=0,0,IF(D1="Final" ,B1,IF(B1C1,B1,C1))))
The problem seems to be with the last step of the formula IF(B1C1,B1,C1 ...
for a negative condition in both B1 and C1 the formula has to be
IF(B1C1,B1,C1. And then there is the possibility of positive condition in
one cell or the other with a negative value in the opposite cell. Is there
another operator that I can use that elaluates B1 & C1 for a positive or
negative condition and changes the value in A1 as follows;
IF(B1="",C1, --- changes the value in A1 to the value in C1 if B1 is
blank
IF(B1=0,0, --- changes the value in A1 to the value in B1 if B1 is 0
IF(D1="Final",B1 --- changes the value in A1 to the value in B1 if D1 is
"Final"
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have positive values
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have negative values

Your specifications are not clear. There are conflicts. That may be
contributing to your coding difficulties.

For example

1. If B1 is blank and D1="Final", should A1 display C1 or B1 or something
else?
2. What should be displayed if B1 is positive and C1 is negative?
3. In Excelspeak, BLANK means EMPTY. Is that what you mean, also? Or is
there some formula there?

As you write your description, your formula could be:

=IF(AND(D1="Final",ISBLANK(B1)),"undefined",
IF(ISBLANK(B1),C1,
IF(OR(B1=0,D1="Final",SIGN(B1)=SIGN(C1)),B1,
IF(SIGN(B1)SIGN(C1),"undefined"))))

But I think you need to further clarify your logic. Perhaps this formula will
help.
--ron

OK ... here it is.

The value of A1 is conditioned on the value of B1, C1, & D1. It is never
manually changed.

A1 is a numeric cell. There are 3 possibilities for the value in A1; 0,
positive number, negative number. Never Blank (empty).

B1 is a numeric cell. There are 4 possibilities for the value in B1; Blank
(empty), 0, positive number, negative number. B1 always starts with a Blank
(empty) value.

C1 is a numeric cell. There are 3 possibilities for the value in C1; 0,
positive number, negative number. Never Blank (empty). Usually the value in
C1 does not change after the start value is input. C1 is never updated by
changes to A1, B1.

* D1 is a text cell. There are 2 possibilities for the value in D1;
Final, Blank (empty). D1 always starts with a Blank (empty) value. The
value is never changed to Final if B1 is Blank (empty). D1 is never
updated by changes to A1, B1, C1.

The logic goes like this:

Since B1and D1 are Blank at the start, then A1 should be the same value as C1.

If I change B1 to 0 then A1 should change to 0; C1 & D1 do not change.

* The following assumes that B1 is not Blank (empty) hence the statement
above. If I change D1 to Final, A1 should change to the same value as B1.

If C1 is a positive value and I change B1 to a positive value;
A1 should not change if B1 is smaller than C1, but A1 should change to the
value of B1 if B1 is larger than C1.
Example: A1=100, B1=Blank, C1=100. I change B1 to 50 and A1 does not change
but if I change B1 to 150 then A1 changes to 150.

IF C1 is a negative value and I change B1 to a negative value;
A1 should not change if B1 is a smaller or lesser negative value than C1,
but should change to the same value of B1 if B1 is a greater or larger
negative value than C1. Example: A1=-100, B1=Blank, C1=-100. I change B1 to
-50 and A1 does not change but if I change B1 to -150 then A1 changes to -150.

IF C1 is a positive value and I change B1 to a negative value;
A1 should change to the same negative value as B1.

If C1 is a negative value and I change B1 to a positive value;
A1 should change to the same positive value as B1.



Try this:

=IF(D1="Final",B1,
IF(ISBLANK(B1),C1,
IF(OR(B1=0,D1="Final",SIGN(B1)=SIGN(C1)),
MAX(ABS(B1),ABS(C1))*SIGN(B1),
IF(SIGN(B1)SIGN(C1),B1))))


--ron


--ron
  #7  
Old October 31st, 2005, 02:41 PM
Bob in Oklahoma
external usenet poster
 
Posts: n/a
Default I Need a formula to evaluate a cell with + or - values

That explanation also helps ... thanks again.

"Ron Rosenfeld" wrote:

Glad it works for you. Thanks for the feedback.

You should be able to tease out the meaning by looking at it line by line, and
comparing it to what you specified.

SIGN is a function that returns -1 if the number is negative, and +1 if the
number is positive (and 0 if the number is 0).

ABS returns the positive value of any number; so both -15 and +15 would return
+15.

=IF(D1="Final",B1,
IF(ISBLANK(B1),C1,
IF(OR(B1=0,D1="Final",SIGN(B1)=SIGN(C1)),
MAX(ABS(B1),ABS(C1))*SIGN(B1),
IF(SIGN(B1)SIGN(C1),B1))))



On Sun, 30 Oct 2005 17:49:02 -0800, Bob in Oklahoma
wrote:

You rock Ron, Thanks!
I don't understand the mechanics but it works and I'm greatful. I'll be a
long time trying to learn how it works.

"Ron Rosenfeld" wrote:

On Fri, 28 Oct 2005 20:22:01 -0700, Bob in Oklahoma
wrote:



"Ron Rosenfeld" wrote:

On Fri, 28 Oct 2005 12:09:06 -0700, Bob in Oklahoma Bob in
wrote:

The formula in Cell A1 evaluates the values in B1, C1, and D1. B1 can be
blank or have numerical values either positive or negative. C1 always has
numerical values but can be positive or negative. D1 is either blank or has
a text value of "Final". The value of A1 changes based on the condition of
B1 & D1. There are four possible conditions for B1; Blank, 0, positive value,
or negative value. Here is the formula that I have which works as long as
the values in B1 & C1 are both positive.
=IF(B1="",IF(B1C1,B1,C1),IF(B1=0,0,IF(D1="Final" ,B1,IF(B1C1,B1,C1))))
The problem seems to be with the last step of the formula IF(B1C1,B1,C1 ...
for a negative condition in both B1 and C1 the formula has to be
IF(B1C1,B1,C1. And then there is the possibility of positive condition in
one cell or the other with a negative value in the opposite cell. Is there
another operator that I can use that elaluates B1 & C1 for a positive or
negative condition and changes the value in A1 as follows;
IF(B1="",C1, --- changes the value in A1 to the value in C1 if B1 is
blank
IF(B1=0,0, --- changes the value in A1 to the value in B1 if B1 is 0
IF(D1="Final",B1 --- changes the value in A1 to the value in B1 if D1 is
"Final"
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have positive values
IF(B1C1,B1 --- changes the value in A1 to the value in B1 if B1 & C1
both have negative values

Your specifications are not clear. There are conflicts. That may be
contributing to your coding difficulties.

For example

1. If B1 is blank and D1="Final", should A1 display C1 or B1 or something
else?
2. What should be displayed if B1 is positive and C1 is negative?
3. In Excelspeak, BLANK means EMPTY. Is that what you mean, also? Or is
there some formula there?

As you write your description, your formula could be:

=IF(AND(D1="Final",ISBLANK(B1)),"undefined",
IF(ISBLANK(B1),C1,
IF(OR(B1=0,D1="Final",SIGN(B1)=SIGN(C1)),B1,
IF(SIGN(B1)SIGN(C1),"undefined"))))

But I think you need to further clarify your logic. Perhaps this formula will
help.
--ron

OK ... here it is.

The value of A1 is conditioned on the value of B1, C1, & D1. It is never
manually changed.

A1 is a numeric cell. There are 3 possibilities for the value in A1; 0,
positive number, negative number. Never Blank (empty).

B1 is a numeric cell. There are 4 possibilities for the value in B1; Blank
(empty), 0, positive number, negative number. B1 always starts with a Blank
(empty) value.

C1 is a numeric cell. There are 3 possibilities for the value in C1; 0,
positive number, negative number. Never Blank (empty). Usually the value in
C1 does not change after the start value is input. C1 is never updated by
changes to A1, B1.

* D1 is a text cell. There are 2 possibilities for the value in D1;
“Final”, Blank (empty). D1 always starts with a Blank (empty) value. The
value is never changed to “Final” if B1 is Blank (empty). D1 is never
updated by changes to A1, B1, C1.

The logic goes like this:

Since B1and D1 are Blank at the start, then A1 should be the same value as C1.

If I change B1 to 0 then A1 should change to 0; C1 & D1 do not change.

* The following assumes that B1 is not Blank (empty) hence the statement
above. If I change D1 to “Final”, A1 should change to the same value as B1.

If C1 is a positive value and I change B1 to a positive value;
A1 should not change if B1 is smaller than C1, but A1 should change to the
value of B1 if B1 is larger than C1.
Example: A1=100, B1=Blank, C1=100. I change B1 to 50 and A1 does not change
but if I change B1 to 150 then A1 changes to 150.

IF C1 is a negative value and I change B1 to a negative value;
A1 should not change if B1 is a smaller or lesser negative value than C1,
but should change to the same value of B1 if B1 is a greater or larger
negative value than C1. Example: A1=-100, B1=Blank, C1=-100. I change B1 to
-50 and A1 does not change but if I change B1 to -150 then A1 changes to -150.

IF C1 is a positive value and I change B1 to a negative value;
A1 should change to the same negative value as B1.

If C1 is a negative value and I change B1 to a positive value;
A1 should change to the same positive value as B1.


Try this:

=IF(D1="Final",B1,
IF(ISBLANK(B1),C1,
IF(OR(B1=0,D1="Final",SIGN(B1)=SIGN(C1)),
MAX(ABS(B1),ABS(C1))*SIGN(B1),
IF(SIGN(B1)SIGN(C1),B1))))


--ron


--ron

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
put formula results into a different cell if it is empty PutFormula Worksheet Functions 2 February 11th, 2005 03:31 AM
How do I write formula to compare two values and pull the resulta. Renee Worksheet Functions 1 February 11th, 2005 01:31 AM
Cell Values Formula BubbaJ Worksheet Functions 1 January 30th, 2005 11:40 PM
Cell shows formula and not the result of the formula. stumpy1220 Worksheet Functions 2 January 14th, 2005 05:11 PM
Formula to Count and Return Most common Value in a Dynamic Named Range Tin General Discussion 1 October 23rd, 2004 11:26 PM


All times are GMT +1. The time now is 06:55 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.