If then Statments

  • Thread starter Thread starter Tina
  • Start date Start date
T

Tina

Okay this is what I have. I have a number based on flucuating metal prices
and a constant that is the cost of the part right now. I want to write a
formula that will give me if the number increases/decreases then add/subtract
the difference to another column. For some reason I can get the first part
=IF(k2<2.489,) but i don't know how to finish the formula. Please help.

Tina
 
If the value in K2 is not equal to 2.489, then display the difference
between K2 and A1
Try these out. You may need to reverse K2 and A1 - and only you know what to
use for A1
=IF(K2<>2.489,K2-A1,"no change")
=IF(K2<>2.489,K2-A1,"")
best wishes
 
I have a number based on flucuating metal prices and
a constant that is the cost of the part right now.
 I want to write a formula that will give me if the number
increases/decreases then add/subtract the difference to
another column.  For some reason I can get the first part
=IF(k2<2.489,) but i don't know how to finish the formula.

As I understand your problem (not very well, I admit), all you need
is:

=A1 + K2 - 2.489

where K2 is "the number [that] increases/decreases" compared to a
constant (2.489), and A1 is "another column" (cell) to which you want
to "add/subtract the difference" between K2 and the constant.

Caveat: It is unlikely that K2 will ever exactly equal 2.489, even if
it appears that way, unless you enter that number into K2. To be sure
that the difference is WYSIWYG, if you display to 3 decimal places, it
might be better to write:

=A1 + (round(K2,3) - 2.489)
 
This is very good but I only want the difference from cell A to be added or
subtracted from a.
 
Well the real issue is that if the metal price (A) changes I need to add or
subtract the difference in the change to or from the orginial price.

joeu2004 said:
I have a number based on flucuating metal prices and
a constant that is the cost of the part right now.
I want to write a formula that will give me if the number
increases/decreases then add/subtract the difference to
another column. For some reason I can get the first part
=IF(k2<2.489,) but i don't know how to finish the formula.

As I understand your problem (not very well, I admit), all you need
is:

=A1 + K2 - 2.489

where K2 is "the number [that] increases/decreases" compared to a
constant (2.489), and A1 is "another column" (cell) to which you want
to "add/subtract the difference" between K2 and the constant.

Caveat: It is unlikely that K2 will ever exactly equal 2.489, even if
it appears that way, unless you enter that number into K2. To be sure
that the difference is WYSIWYG, if you display to 3 decimal places, it
might be better to write:

=A1 + (round(K2,3) - 2.489)
 
Well the real issue is that if the metal price
(A) changes I need to add or subtract the difference
in the change to or from the orginial price.

I believe that is the formula I provided.

In your original formula, what is K2, and what is 2.489?

I assumed that K2 is the current price, and 2.489 is the previous
price. In my example, A1 is a cell in the "another column" to which
you want to add or subtract the difference.

Note that if there is no difference (K2 = 2.489), we "add or subtract"
zero. No harm in that.

Of course, if you would like that difference in a cell of its own,
then write:

=K2 - 2.489

If that is cell K3, then my original formula becomes =A1+K3 .

If I misunderstood, I suggest that you stop talking in abstract terms
(names like "A" and "a" in your response to Bernard), and start
talking in Excel terms (real cell names, clearly identifying their
purpose).


----- original posting -----

Well the real issue is that if the metal price (A) changes I need to add or
subtract the difference in the change to or from the orginial price.



As I understand your problem (not very well, I admit), all you need
is:
=A1 + K2 - 2.489
where K2 is "the number [that] increases/decreases" compared to a
constant (2.489), and A1 is "another column" (cell) to which you want
to "add/subtract the difference" between K2 and the constant.
Caveat:  It is unlikely that K2 will ever exactly equal 2.489, even if
it appears that way, unless you enter that number into K2.  To be sure
that the difference is WYSIWYG, if you display to 3 decimal places, it
might be better to write:
=A1 + (round(K2,3) - 2.489)
 
Back
Top