Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Heather Heather is offline
external usenet poster
 
Posts: 22
Default Question about IF & INCLUDETEXT with a number range

Me again. My merge questions just keep on coming.

I'm still working with IF and INCLUDETEXT statements to build admission
letters for students. I'm working on a statement that looks at the
admission average and determines which admission award to give. The
first range of averages would be from 80.0-84.9%, then 85.0-89.9%, and
then 90% and above. The averages reported appear in my gigantic (so
gigantor I can't open it in Excel) csv file. Here's the kicker - the
average can appear in one of six positions in the csv file.

So I've got this so far:

{if {mergefield admittype}="HS" {if {mergefield evalcmp111}="2010" {if
{mergefield evalcmpvalue111}="80"{if {mergefield
evalcmp111}="84.9"{includetext c:\\master_comment.doc
admission_award}""}""}""}""}

Which, naturally, isn't working when I test it...is it just my spacing?
Is there a better way to do this?

Thanks again for your help...it is greatly appreciated.

Heather

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Heather Heather is offline
external usenet poster
 
Posts: 22
Default Question about IF & INCLUDETEXT with a number range

Squee! I answered my own question.

{if {mergefield admittype}="HS" {if {mergefield evalcmp111}="2010" {if
{mergefield evalcmpvalue111}="80" {if {mergefield
evalcmpvalue111}"85" {includetext c:\\master_comment.doc
admission_award_80_to_84} ""} ""} ""} ""}

....with five more instances (using evalcmp111, 112, 113, etc) to
account for each case of 80.0-84.9% average. And then rinse, repeat,
and six more big IFs for the 85-89%.

Is there any difference between entering 80.0 and 80?

Go live is now in...8 days, 22 hours, 14 minutes. Me stressed?
Noooooo...



Heather

Heather wrote:
Me again. My merge questions just keep on coming.

I'm still working with IF and INCLUDETEXT statements to build admission
letters for students. I'm working on a statement that looks at the
admission average and determines which admission award to give. The
first range of averages would be from 80.0-84.9%, then 85.0-89.9%, and
then 90% and above. The averages reported appear in my gigantic (so
gigantor I can't open it in Excel) csv file. Here's the kicker - the
average can appear in one of six positions in the csv file.

So I've got this so far:

{if {mergefield admittype}="HS" {if {mergefield evalcmp111}="2010" {if
{mergefield evalcmpvalue111}="80"{if {mergefield
evalcmp111}="84.9"{includetext c:\\master_comment.doc
admission_award}""}""}""}""}

Which, naturally, isn't working when I test it...is it just my spacing?
Is there a better way to do this?

Thanks again for your help...it is greatly appreciated.

Heather


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Question about IF & INCLUDETEXT with a number range

Is there any difference between entering 80.0 and 80?

Maybe - tests in IF fields tend to be textual rather than numeric,
especially if you quote the second comparand. In this case it may work
whatever the value, but if you test and discover that isn't so, you may be
able to use { = } field to do the comparison.

Personally, I would double quote text operands. Some programmers seem to
tegard them as redundant because the IF typically works without them, but
they are not - in some circumstances behaviour is different when you leave
them out. But the following is mainly just my personal preference (the line
breaks and spacing on the left hand side of the lines are just for
presentation purposes):

{ IF "{MERGEFIELD admittype }" = "HS"
"{ IF "{ MERGEFIELD evalcmp111 }" = "2010"
"{ IF "{ MERGEFIELD evalcmpvalue111 }" = "80"
"{ IF "{ MERGEFIELD evalcmpvalue111 }" "85"
"{ INCLUDETEXT "c:\\master_comment.doc" admission_award_80_to_84}"
"" }"
"" }"
"" }"
"" }

Peter Jamieson

"Heather" wrote in message
oups.com...
Squee! I answered my own question.

{if {mergefield admittype}="HS" {if {mergefield evalcmp111}="2010" {if
{mergefield evalcmpvalue111}="80" {if {mergefield
evalcmpvalue111}"85" {includetext c:\\master_comment.doc
admission_award_80_to_84} ""} ""} ""} ""}

...with five more instances (using evalcmp111, 112, 113, etc) to
account for each case of 80.0-84.9% average. And then rinse, repeat,
and six more big IFs for the 85-89%.

Is there any difference between entering 80.0 and 80?

Go live is now in...8 days, 22 hours, 14 minutes. Me stressed?
Noooooo...



Heather

Heather wrote:
Me again. My merge questions just keep on coming.

I'm still working with IF and INCLUDETEXT statements to build admission
letters for students. I'm working on a statement that looks at the
admission average and determines which admission award to give. The
first range of averages would be from 80.0-84.9%, then 85.0-89.9%, and
then 90% and above. The averages reported appear in my gigantic (so
gigantor I can't open it in Excel) csv file. Here's the kicker - the
average can appear in one of six positions in the csv file.

So I've got this so far:

{if {mergefield admittype}="HS" {if {mergefield evalcmp111}="2010" {if
{mergefield evalcmpvalue111}="80"{if {mergefield
evalcmp111}="84.9"{includetext c:\\master_comment.doc
admission_award}""}""}""}""}

Which, naturally, isn't working when I test it...is it just my spacing?
Is there a better way to do this?

Thanks again for your help...it is greatly appreciated.

Heather




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
page number positioning and format tinaa Page Layout 3 February 4th 06 12:38 AM
VBA: For Each Cell in Range jumps out of range? Ed Tables 2 January 26th 06 05:51 PM
Is there a limit of words you can put in tables? lkwink Tables 4 October 16th 05 03:15 PM
Consecutive number question Crhoff Mailmerge 6 June 24th 05 06:25 AM
Maximum number of pages in a word document Travis75 Formatting Long Documents 5 January 27th 05 05:03 AM


All times are GMT +1. The time now is 10:13 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"