Hi, i need to compare two numerical fields and place the difference in another part of my document. The sticky part is some times they can be a negative number, is their a compare statement or do i need to declare them differently?
Thanks in advance
Jenni
actually whole numbers like Value a is 1, value b could be 1.1 if is simpley subtract a value returned is -.1 but i also need to show the result value as .1 and -.5 subtract -.7 the return value is .2 and i need it to be -.2
I hope i am explaining myself better
Jenni
Henry - 30 Jan 2004 23:18 GMT
Jenni,
You're taking the bigger number away from the smaller number instead of the
other way round.
If A>B Then
Result =A-B
Else Result =B-A
End If
HTH
Henry
> actually whole numbers like Value a is 1, value b could be 1.1 if is simpley subtract a value returned is -.1 but i also need to show the result
value as .1 and -.5 subtract -.7 the return value is .2 and i need it to
be -.2
> I hope i am explaining myself better
>
> Jenni
macropod - 31 Jan 2004 00:45 GMT
Hi Jenni,
From your description, you are getting the correct results for
ValueA-ValueB=ValueC. What you want requires your formula to be expressed as
ValueB-ValueA=ValueC. If you need to show the same results as +ve values in
some places and as -ve values elsewhere, simply multiply the results by -1
wherever they need to be inverted, eg: (ValueA-ValueB)*-1=ValueC or, if
ValueC is bookmarked, you could use invert the required fields with:
{={ValueC}*-1}
Cheers
> actually whole numbers like Value a is 1, value b could be 1.1 if is simpley subtract a value returned is -.1 but i also need to show the result
value as .1 and -.5 subtract -.7 the return value is .2 and i need it to
be -.2
> I hope i am explaining myself better
>
> Jenni