Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Rounding up in Mergefields
Hello.
Sheets is a mergefield of any positive value. I need to divide this value by 25 each time but need it to round the result up everytime to a whole number. e.g. if sheets = 5, I need the result to be 1 e.g. if sheets = 26, I need the result to be 2 etc. This is my code thus far: { =({MERGEFIELD sheets}/25 \# 0} Any help would be appreciated. Thanks. |
#2
|
|||
|
|||
Hi,
Word doesn't have a roundup/down function, but you can simulate one with a bit of field maths: {=ROUND(({MERGEFIELD sheets}/25+(MOD({MERGEFIELD sheets},25)0)/2/25),0)*25} See my Word Field Maths 'tutorial' at: http://www.wopr.com/cgi-bin/w3t/show...?Number=365442 for more details. Cheers "SSwan" wrote in message ... Hello. Sheets is a mergefield of any positive value. I need to divide this value by 25 each time but need it to round the result up everytime to a whole number. e.g. if sheets = 5, I need the result to be 1 e.g. if sheets = 26, I need the result to be 2 etc. This is my code thus far: { =({MERGEFIELD sheets}/25 \# 0} Any help would be appreciated. Thanks. |
#3
|
|||
|
|||
Thanks, I tried that but with a test input of 2, 5, 25, 26, 50, 54, 75, 845 I
got answers of 0, 0, 25, 25, 50, 50, 75, 850 instead of 1, 1, 1, 2, 2, 3, 3, 34??? Doesn't WOPR send Woodys watch etc? I get that. .... "macropod" wrote: Hi, Word doesn't have a roundup/down function, but you can simulate one with a bit of field maths: {=ROUND(({MERGEFIELD sheets}/25+(MOD({MERGEFIELD sheets},25)0)/2/25),0)*25} See my Word Field Maths 'tutorial' at: http://www.wopr.com/cgi-bin/w3t/show...?Number=365442 for more details. Cheers "SSwan" wrote in message ... Hello. Sheets is a mergefield of any positive value. I need to divide this value by 25 each time but need it to round the result up everytime to a whole number. e.g. if sheets = 5, I need the result to be 1 e.g. if sheets = 26, I need the result to be 2 etc. This is my code thus far: { =({MERGEFIELD sheets}/25 \# 0} Any help would be appreciated. Thanks. |
#4
|
|||
|
|||
SSwan,
Macropod will most likely be back to sort you out with his method. In the meantime this appears to work: {=INT({TEST}/25 + { IF { =MOD({ Test},25)} "0""1""0" }) } |
#5
|
|||
|
|||
Thank you very much Greg. It works a treat.
Kindest regards. "Greg" wrote: SSwan, Macropod will most likely be back to sort you out with his method. In the meantime this appears to work: {=INT({TEST}/25 + { IF { =MOD({ Test},25)} "0""1""0" }) } |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How I write a complex equation using mergefields in Word 2000? | Mailmerge | |||
Replace mergefields with form fields | Mailmerge | |||
Rounding | Tables | |||
Working with Mergefields | New Users | |||
Rounding Down in Word | Tables |