View Single Post
 
Old 10-09-2014, 03:02 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,345
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

A word formula using a cell reference cannot differentiate between 0 and empty. However, it can be done if the ranges are bookmarked and you test the bookmark contents. The easiest way to do that is to use formfields for the data entry in a document using forms protection. That also gives you the advantage of being able to use the formfields' 'calculate on exit' property to auto-update the calculations.

In a generalised sense, the calculation field to evaluate the content is:
{IF{REF MyFld} = {=MyFld} "{MyFld} is Numeric" "{MyFld} is Text"}}
where 'MyFld' is the formfield's internal bookmark name.

Thus, for your purposes, the field might be coded as:
{IF{REF Text1} = {=Text1} {IF{REF Text2} = {=Text2} {={Text1}-{=Text2} \# "+0,00;-0,00;0,00"}}}
where 'Text1' & 'Text2' are the formfields' internal bookmark names.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote