ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If then Statments (https://www.excelbanter.com/excel-worksheet-functions/217182-if-then-statments.html)

tina

If then Statments
 
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

Bernard Liengme

If then Statments
 
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
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Tina" wrote in message
...
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




joeu2004

If then Statments
 
On Jan 20, 8:46*am, Tina wrote:
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)

tina

If then Statments
 
This is very good but I only want the difference from cell A to be added or
subtracted from a.

"Bernard Liengme" wrote:

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
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Tina" wrote in message
...
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





tina

If then Statments
 
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" wrote:

On Jan 20, 8:46 am, Tina wrote:
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)


joeu2004

If then Statments
 
On Jan 20, 11:28 am, Tina wrote:
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 -----

On Jan 20, 11:28*am, Tina wrote:
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" wrote:
On Jan 20, 8:46 am, Tina wrote:
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)



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com