View Single Post
  #4   Report Post  
Posted to microsoft.public.word.tables
Steven M (remove wax and invalid to reply) Steven M (remove wax and invalid to reply) is offline
external usenet poster
 
Posts: 5
Default IF formula with multiple conditions

Je Thu, 19 Jul 2007 23:44:49 -0500, "Steven M (remove wax and invalid
to reply)" skribis:

Je Thu, 19 Jul 2007 17:28:01 -0700, Modern Farm & Ranch
skribis:

I want to accomplish this in Word using Field Code (CTL+F9) (A value is
entered into "Text1"):
IF Text1=1500 then 225
IF Text1 1500 =2500 then 325
IF Text1 2500=3500 then 455
IF Text1 3500 then Text1*.13
I can't seem to figure out the correct syntax.

Any help would be very much appreciated!


I'm not sure what you mean by "entered into". I'm assuming here that
you have defined a bookmark somewhere else in the document, named
Text1. Also the braces have to be created by Ctrl-F9, not by typing
them. Here it is:


Sorry, a couple of bugs. This should work:

{ if { ref Text1 } 3500 { = { ref Text1 } * 1.13 } { if { ref Text1
} 2500 455 { if { ref Text1 } 1500 325 225 } } }

How it works might be clearer if I add program-style line breaks and
indenting:


{
if { ref Text1 } 3500
{ = { ref Text1 } * 1.13 }
{
if { ref Text1 } 2500
455
{
if { ref Text1 } 1500
325
225
}
}
}


--
Steven M - lid
(remove wax and invalid to reply)

"It's a damned fool mind that can only think of one way to
spell a word." -- attributed to Dizzy Dean