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 / Mailmerge and Fax / March 2004

Tip: Looking for answers? Try searching our database.

Report if #entry is between 2 numbers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob - 17 Mar 2004 18:26 GMT
I'm trying to determine if a text form field (Type =
Number, Bookmark = Test1, Calculate on Exit, Fill-in
Enabled) entry is between 1 and 3.  

I would like a separate field to state whether the entry
is "Pass" or "Fail" so I setup a CALCULATED field.

In Excel, it could be done with:
=IF(B28>1,IF(B28<3,"PASS","FAIL"), "FAIL")
where B28 is the number to check.

In WORD, I've tried to setup a CALCULATED field as
follows, Type: Calculated, Expression: {IF Test1>1 "{IF
Test1<3 "Pass" "Fail"}" "Fail"}.

However, after entering a number in the number field, the
caculated field does not report Pass/Fail and the field
remains blank.

Can you help?
Thanks,
Rob
Greg Maxey - 17 Mar 2004 21:00 GMT
Rob,

I don't think you can do that with a text calculation
field in Word.

You can insert a Word IF field in the document while it
unprotected that will return the result required:

{ IF Test1 > 1 {IF Test1 < 3 &#8220;Pass&#8221;&#8220;Fail&#8221; }&#8220;Fail&#8221;}

>-----Original Message-----
>I'm trying to determine if a text form field (Type =
[quoted text clipped - 20 lines]
>Rob
>.
Rob - 17 Mar 2004 23:25 GMT
Hi Greg,
Thanks for getting back to me.  I tried what you suggested
by copying/pasteing it into my document - unfortunately it
didn't work for me.  It always displayed "Text1".

Since I'm really new to this, I'll spell out what I did.  
These were my steps:
1.  Insert a WORD IF
a.  Insert -> Field
b.  In the Field Code entry window, I entered:
IF Test1 > 1 {IF Test1 < 3 "Pass""Fail" }"Fail"
c.  Pressed OK.
2.  Entered a number into the Test1 field.
3.  Observed that the WORD IF field only displayed Test1.

When I right-click the WORD IF and click 'Toggle Field
Codes', it displays
{IF Test1 > 1 {IF Test1 < 3 "Pass""Fail" }"Fail" }
\*MERGEFORMAT }

Any other suggestions?
Rob
>-----Original Message-----
>Rob,
[quoted text clipped - 33 lines]
>>
>.
Charles Kenyon - 18 Mar 2004 00:25 GMT
Try putting quotation marks around your embedded IF field.

You've got an extra field brace in there.

The following works.

{ IF Test1 > 1 "{ IF Test1 < 3 "Pass""Fail" }"  "Fail"  \* CHARFORMAT }

I changed MergeFormat to CharFormat because it is more likely to yield
desired results in most fields. In this field, I doubt that either is
useful.

Signature

Charles Kenyon

See the MVP FAQ: <URL: http://www.mvps.org/word/> which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> Hi Greg,
> Thanks for getting back to me.  I tried what you suggested
[quoted text clipped - 56 lines]
> >>
> >.
Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL ADDRESS - 18 Mar 2004 00:46 GMT
Why the nested IF statements.  Seems to me that you need

{ IF { = B28 } = 2 "Pass" "Fail" }

You must use Ctrl+F9 to insert each pair of field delimiters {}
Signature

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested.  Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps

> Hi Greg,
> Thanks for getting back to me.  I tried what you suggested
[quoted text clipped - 56 lines]
>>>
>>.
Greg Maxey - 18 Mar 2004 01:23 GMT
Doug,

I considered this but thoguth he might be entering fractional values e.g.,
1.5, 2.3, etc,

Signature

Greg Maxey
A peer in "peer to peer" support
Rockledge, FL
To e-mail, edit out the "w...spam" in gmaxey@whamspammvps.org

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL
ADDRESS wrote:

> Why the nested IF statements.  Seems to me that you need
>
[quoted text clipped - 63 lines]
>>>>
>>> .
Rob - 18 Mar 2004 22:50 GMT
I just wanted to thank you guys for all your help - it's
working!  

I do have fractional numbers to deal with so I did need
the nested IF statements.  My problem was not using the
Cntrl+F9 to enter the {}.  Once a field is opened (e.g.
Insert->Field), Cntrl+F9 doesn't work.  However, when I
just hit Ctnrl+F9 on the WORD document itself, it created
the field and entered the {} at the same time.

It's really straight forward now, but until I grasped that
process, I was up against a wall.

Anyhow, thanks again for all your help.
Rob
>-----Original Message-----
>Doug,
[quoted text clipped - 71 lines]
>
>.
Greg Maxey - 18 Mar 2004 01:22 GMT
Rob,

Use CTRL+F9 to enter the field code brace {  } for both the first IF field
and the nested IF field.

Signature

Greg Maxey
A peer in "peer to peer" support
Rockledge, FL
To e-mail, edit out the "w...spam" in gmaxey@whamspammvps.org

> Hi Greg,
> Thanks for getting back to me.  I tried what you suggested
[quoted text clipped - 55 lines]
>>>
>> .
 
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.