Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel cell displays rounded # - unrounds in mailmerge field

Status
Not open for further replies.

binglelmh

Technical User
Dec 27, 2004
14
0
0
US
I have an Excel datasource consisting of names, addresses and an insurance premium amount from 1.00 to 59.00. The number in the cell is formatted as accounting with 2 decimal places (no $ sign).

The mail merge main document (after the merge) pulls the correct name and address but displays an unrounded number in the insurance premium field. Ex: if Excel cell displays 6.78, the mail merge field displays 6.78000002.

I've never experienced this before. Can anyone help?
 
Can you change the source data to =round(....,2)?
If you can't modify the existing data to do this then Tools,Options, Precision as displayed then save with a new file name if you do not want the 'real' data changed in this way.
There may of course be an elegant mailmerge solution...

Gavin
 
Hi binglelmh,

To control number & currency formatting in Word, add a numeric picture switch to the mergefield. To do this:
. select the field;
. press Shift-F9 to reveal the field coding. It should look something like {MERGEFIELD MyData};
. edit the field so that you get {MERGEFIELD MyData \# $,0.00} (or whatever other numeric format you prefer - see below);
. position the cursor anywhere in this field and press F9 to update it;
. run your mailmerge.

Note: The '\# $,0.00' in the field is referred to as a numeric picture switch. Other possibilities include:
. \# 0 for rounded whole numbers
. \# ,0 for rounded whole numbers with a thousands separator
. \# ,0.00 for numbers accurate to two decimal places, with a thousands separator
. \# $,0 for rounded whole dollars with a thousands separator
. \# $,0.00;($,0.00);'-' for currency, with brackets around negative numbers and a hyphen for 0 values


The precision of the displayed value is controlled by the '0.00'. You can use anything from '0' to '0.000000000000000'.


Cheers
[MS MVP - Word]
 
Another great piece of advice from Macropod about preserving the formatting of your original data (which I have found very useful in the past): Thread 1341696

Fen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top