Verify calculation

J

Johanna Gronlund

Hello,

I have some simple calculations on my word document, for example =SUM(text1,
text2). I need to check whether this calculation is identical to another
field that the users add elsewhere. Is there a way to do this?

Thanks in advance.
 
D

DaveLett

Hi Johanna,
I think you can use something like the following (3 fields):

{ IF { =SUM(text1,text2) } = { REF text3 } "Same Value" "Different Value" }

HTH,
Dave
 
J

Johanna Gronlund

Thanks Dave,

I have tried this but it returns syntax error. Are there any obvious things
that I could have got wrong? I already checked that the bookmarks correspond
to the ones in formulas. I am not sure what I am doing wrong.

Many thanks
 
M

macropod

Hi Johanna,

If the fields don't have a number as the default value, you'll get a syntax error. Another formula you could use is:
{IF{=Text1+Text2-Text3}= 0 "Same" "Different"} Value

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message. Each of the formfields should also have the 'calculate on exit' property checked.
 
J

Johanna Gronlund

Hi,

Thanks for both responses. I have managed to get the =Text4+Text5-Text6=0 to
work but when I add the "Same" "Different"} Value part, I get error saying
error! missing test condition. I get the same message if I break down the
formula recommended by Dave to these two steps, again when I add the "Same
Value" "Different Value" part.

Thanks for your continuing support



macropod said:
Hi Johanna,

If the fields don't have a number as the default value, you'll get a syntax error. Another formula you could use is:
{IF{=Text1+Text2-Text3}= 0 "Same" "Different"} Value

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message. Each of the formfields should also have the 'calculate on exit' property checked.

--
Cheers
macropod
[Microsoft MVP - Word]


Johanna Gronlund said:
Thanks Dave,

I have tried this but it returns syntax error. Are there any obvious things
that I could have got wrong? I already checked that the bookmarks correspond
to the ones in formulas. I am not sure what I am doing wrong.

Many thanks
 
J

Johanna Gronlund

Also, I now get a warning message on my more simple calculation =SUM(Text4,
Text5). This used to work fine until one of my users entered 0 into Text4.
All the fields where numbers are entered are defined as whole numbers. After
that the warning message !Undefined Bookmark, TEXT4 has been displayed, even
after I have changed the field to number larger than 0 and pressed upodate
field (altought I have also selected the update on exit tick box).

Thanks again.



macropod said:
Hi Johanna,

If the fields don't have a number as the default value, you'll get a syntax error. Another formula you could use is:
{IF{=Text1+Text2-Text3}= 0 "Same" "Different"} Value

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message. Each of the formfields should also have the 'calculate on exit' property checked.

--
Cheers
macropod
[Microsoft MVP - Word]


Johanna Gronlund said:
Thanks Dave,

I have tried this but it returns syntax error. Are there any obvious things
that I could have got wrong? I already checked that the bookmarks correspond
to the ones in formulas. I am not sure what I am doing wrong.

Many thanks
 
M

macropod

Hi Johanna,

I think you'd better check that the formfields actually have the relevant bookmark names. The error message suggests the Text4
bookmark doesn't exist.

--
Cheers
macropod
[Microsoft MVP - Word]


Johanna Gronlund said:
Also, I now get a warning message on my more simple calculation =SUM(Text4,
Text5). This used to work fine until one of my users entered 0 into Text4.
All the fields where numbers are entered are defined as whole numbers. After
that the warning message !Undefined Bookmark, TEXT4 has been displayed, even
after I have changed the field to number larger than 0 and pressed upodate
field (altought I have also selected the update on exit tick box).

Thanks again.



macropod said:
Hi Johanna,

If the fields don't have a number as the default value, you'll get a syntax error. Another formula you could use is:
{IF{=Text1+Text2-Text3}= 0 "Same" "Different"} Value

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message. Each of the formfields should also have the 'calculate on exit' property checked.

--
Cheers
macropod
[Microsoft MVP - Word]


Johanna Gronlund said:
Thanks Dave,

I have tried this but it returns syntax error. Are there any obvious things
that I could have got wrong? I already checked that the bookmarks correspond
to the ones in formulas. I am not sure what I am doing wrong.

Many thanks



:

Hi Johanna,
I think you can use something like the following (3 fields):

{ IF { =SUM(text1,text2) } = { REF text3 } "Same Value" "Different Value" }

HTH,
Dave

:

Hello,

I have some simple calculations on my word document, for example =SUM(text1,
text2). I need to check whether this calculation is identical to another
field that the users add elsewhere. Is there a way to do this?

Thanks in advance.
 
M

macropod

Hi Johanna ,

You have to be careful with the spaces between the various expressions - there must be a space in '= 0'.

--
Cheers
macropod
[Microsoft MVP - Word]


Johanna Gronlund said:
Hi,

Thanks for both responses. I have managed to get the =Text4+Text5-Text6=0 to
work but when I add the "Same" "Different"} Value part, I get error saying
error! missing test condition. I get the same message if I break down the
formula recommended by Dave to these two steps, again when I add the "Same
Value" "Different Value" part.

Thanks for your continuing support



macropod said:
Hi Johanna,

If the fields don't have a number as the default value, you'll get a syntax error. Another formula you could use is:
{IF{=Text1+Text2-Text3}= 0 "Same" "Different"} Value

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message. Each of the formfields should also have the 'calculate on exit' property checked.

--
Cheers
macropod
[Microsoft MVP - Word]


Johanna Gronlund said:
Thanks Dave,

I have tried this but it returns syntax error. Are there any obvious things
that I could have got wrong? I already checked that the bookmarks correspond
to the ones in formulas. I am not sure what I am doing wrong.

Many thanks



:

Hi Johanna,
I think you can use something like the following (3 fields):

{ IF { =SUM(text1,text2) } = { REF text3 } "Same Value" "Different Value" }

HTH,
Dave

:

Hello,

I have some simple calculations on my word document, for example =SUM(text1,
text2). I need to check whether this calculation is identical to another
field that the users add elsewhere. Is there a way to do this?

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top