#1
|
|||
|
|||
IF statement - number range
Hello All,
This is a fantastic forum and has been very useful with helping me to learn about all things mailmerge. I have (hopefully) a very simple problem that is really annoying: I know how to use use basic rules in a mail merge and have been using the IF command. I am trying to get word to place a star in a box depending on the value of a merge field (Percentage Attendance) . So if the value is greater than 95% it puts a star in the top box. This bit is easy using a simple if command: {IF {MERGGEFIELD percentage_attendance}>= 95 "*"} However where I am having a trouble is the next box down where I want a star to appear when the Percentage Attendance is between 90 and 94.9% How do I get the IF statement to compare percentage attendance to a range of numbers? I want something like: {IF {MERGGEFIELD percentage_attendance}= 90-94.9 "*"} This obviously does not work and despite spending ages looking online I can't find how to do it. Obviously if I just use {IF {MERGGEFIELD percentage_attendance}>= 90 "*"} It will put a star in the box for numbers higher than 95 which I do not want. Any help would be much appreciated - I am hoping there is a simple answer! Ian |
#2
|
||||
|
||||
You could simply nest the fields, as in:
{IF {MERGEFIELD percentage_attendance}>= 95 "*" {IF {MERGEFIELD percentage_attendance}>= 90 "**"}} or: {IF {MERGEFIELD percentage_attendance}< 90 "" {IF {MERGEFIELD percentage_attendance}< 95 "**" "*"}} You could even forego the IF test entirely, with: {=(INT({MERGEFIELD percentage_attendance}/5)-18) \# "'*';;'**'"}
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need help with If, Then Statement Please | cangelis | Excel | 4 | 01-03-2014 09:10 AM |
Choose color for different number range | secoo140 | Excel | 9 | 10-07-2013 12:12 PM |
Help with IF Statement | limpbizkit | Excel | 4 | 02-24-2011 09:16 PM |
if statement | piper7971 | PowerPoint | 1 | 08-19-2010 07:10 AM |
Help with IF statement! | CPelkey | Word | 1 | 04-12-2010 09:06 AM |