Excel number in Word Mail Merge

gossv

Board Regular
Joined
Jul 8, 2005
Messages
141
Hi,

I am using excel figures in a word mail merge and they keep showing up in the word document as the wrong format.

I would like the figure to be displayed in the mail merge as 14,316 however it is coming up as 14316.709999999999.

I don't seem to be able to format the figure in word, does anyone have any suggestions on how I would format it in excel?

Thanks

Ginny
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi Ginny
If you just wanted it to 0 decimal places, and didn't mind it rounding up or down, then just right-click the Excel cell(s) in question use "Format Cells" then use "Number" select 0 decimal places, and finally check the box to use the comma as a thousands seperator.
 
Upvote 0
Hi,

I am using excel figures in a word mail merge and they keep showing up in the word document as the wrong format.

I would like the figure to be displayed in the mail merge as 14,316 however it is coming up as 14316.709999999999.

I don't seem to be able to format the figure in word, does anyone have any suggestions on how I would format it in excel?

Thanks

Ginny
I'm not up to speed on using Excel data in a mail merge, but if the 14316.709.... is the result of a formula in Excel, what about changing your formula to something like:
=INT(your_existing_formula)
or maybe
=ROUND(your_existing_formula,0)
 
Upvote 0
Ginny

You can format data in a mail merge.

You use what are called switches.

Check out Help in Word, it's not too bad on the topic.:)
 
Upvote 0
I don't think rounding the number, to another number, is going to be of much help to you, here, because this is floating-point error. This just tends to happen during the Merge...

Convert your data to a text String before sending it off to Word. See the Fixed Function, e.g.,

Code:
=FIXED(A1,1,FALSE)
I suspect it was implemented in Excel for this very case... Since you're going to Word and it's all Strings/Text anyway, you should be fine. :)

Edit: Norie's suggestion may work, too. Does that flip the Data Type?
 
Upvote 0
Nate,

Norie's on the mark regarding switches for merges. You can set the data type to any custom number format by writing it in the fields.

gossv, check the Word helpfile for "Format (\*) field switch ".

HTH,

Smitty
 
Upvote 0
Okay, one of the two is the ticket, then.

The trick is to get the data out of a Double data type, which is prone to floating-point rounding error in this process, or in general, and get this puppy into a Text/String data type, which knows nothing about floating-point. :)
 
Upvote 0
Hi gossv,

The simple solution is to:
. select your mergefield in Word
. press Shift-F9 to expose the field code, which should look something like '{MERGEFIELD ExcelVal}'
. add a '\# 0' numeric switch to the field, thus '{MERGEFIELD ExcelVal \# 0}'
. press F9 to update the field
. run your mailmerge.

There is no need to modify anything in Excel.

Cheers,
macropod
 
Upvote 0

Forum statistics

Threads
1,216,744
Messages
6,132,471
Members
449,729
Latest member
davelevnt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top