New Formular Needed

N

NSF

I have been using some old software to provide what i need but want to move
to Microsoft.

The formular that has been used in the old software (Q&A Version 3) is:

IF Field 2< Field 1 then Field 3 = Field 1 - Field 2 + Field 3 ELSEIF Field
2 > Field 1 then Field 3 = Field 3 - Field 2 + Field 3

Can anyone work out a conversion that will work?

Thanks
 
F

Frank Kabel

Hi
do you need a worksheet function or a VBA solution. For
the former one this could be complicated as you want the
result in the same cell as one of he parameter resides
 
A

Arvi Laanemets

Hi

At first, you have to enter your formula into another column - otherwise you
get a circular reference. And when you enter your formula into some cell
with a value in it, then you overwrite this value - Excel can't get any info
about old value anymore. So the formula will be like this:
Field4=IF(Field2<Field1,Field1-Field2+Field3,2*Field3-Field2)
i.e. something like this in cell D2
=IF(B2<A2,A2-B2+C2,2*C2-B2)
 
B

Bob Phillips

This will not work as you are trying to set Field3 to a value that includes
field3, this will give a circular reference.

If you ahd another field/cell, you could use

=IF(Field2<Field1, Field1-Field2+Field3,IF(Field2>Field1,
Field3-Field2+Field3)

Are you sure about that last condition? Field 3 - Field 2 + Field 3 is the
same as -Field2.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Top