Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2004

Tip: Looking for answers? Try searching our database.

compare two numerical fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jenni - 30 Jan 2004 22:06 GMT
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
Jenni - 30 Jan 2004 22:31 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.