Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2014, 07:52 AM
irhut irhut is offline IF statement - number range Windows Vista IF statement - number range Office 2007
Novice
IF statement - number range
 
Join Date: Feb 2014
Posts: 1
irhut is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 02-11-2014, 11:20 PM
macropod's Avatar
macropod macropod is offline IF statement - number range Windows 7 32bit IF statement - number range Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
IF statement - number range Need help with If, Then Statement Please cangelis Excel 4 01-03-2014 09:10 AM
IF statement - number range Choose color for different number range secoo140 Excel 9 10-07-2013 12:12 PM
IF statement - number range Help with IF Statement limpbizkit Excel 4 02-24-2011 09:16 PM
IF statement - number range if statement piper7971 PowerPoint 1 08-19-2010 07:10 AM
IF statement - number range Help with IF statement! CPelkey Word 1 04-12-2010 09:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:52 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft