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 / December 2004

Tip: Looking for answers? Try searching our database.

# Range inside "Nested If" Statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CJ - 29 Dec 2004 15:19 GMT
I'm merging with an Excel spreadsheet. I want to indicate
a blood alcohol concentration (BAC) depending on the
gender and weight of the individual. Instead of typing in
100 individual weights, I want to group in ranges of 20
lbs: 100 lbs, 120 lbs, 140 lbs, etc. If the individual's
weight is 115 lbs, I want the BAC to report as the BAC for
100 lbs by using a range inside the nested IF statement.
So 100 - 119 lbs will report as the BAC for 100 lbs, 120 -
139 lbs will report BAC for 120 lbs, etc. End result will
appear as:

1 standard drink in 1 hour = .?? BAC
2 standard drinks in 1 hour = .?? BAC
3 standard drinks in 1 hour = .?? BAC

Here's the code I'm currently working with that doesn't
include the range I'm wanting to use:

1 standard drink in 1 hour = {IF{=AND({COMPARE{MERGEFIELD
gender}=F},{COMPARE{MERGEFIELD weight}=100}){}}=1 ".05""{IF
{=AND({COMPARE{MERGEFIELD gender}=M},{COMPARE{MERGEFIELD
weight}=100}){}}=1 ".04""{IF{=AND({COMPARE{MERGEFIELD
gender}=F},{COMPARE{MERGEFIELD weight}=120}){}}=1 ".04""{IF
{=AND({COMPARE{MERGEFIELD gender}=M},{COMPARE{MERGEFIELD
weight}=120}){}}=1 ".04""{IF{=AND({COMPARE{MERGEFIELD
gender}=F},{COMPARE{MERGEFIELD weight}=140}){}}=1 ".04""{IF
{=AND({COMPARE{MERGEFIELD gender}=M},{COMPARE{MERGEFIELD
weight}=140}){}}=1 ".03 etc. etc.

What I need is the syntax that will create the range 100 -
119 and 120 - 139 and ....

Any help will be greatly appreciated! Thanks in advance.

CJ
Greg Maxey - 29 Dec 2004 16:37 GMT
CJ,

This might get you on track.

{ IF { =AND({ Compare{ Gender }=F}, AND({= Wt }>100,{
=Wt }<=119))}="1"".05""Next Condition Statement" }

Signature

Greg Maxey/Word MVP
A Peer in Peer to Peer Support

> I'm merging with an Excel spreadsheet. I want to indicate
> a blood alcohol concentration (BAC) depending on the
[quoted text clipped - 31 lines]
>
> CJ
CJ - 29 Dec 2004 19:56 GMT
Thanks much!!
>-----Original Message-----
>CJ,
[quoted text clipped - 41 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.