954,301 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Mail merge: Excel spreadsheet data to MS Word doc

I've created an Excel spreadsheet that I use to incorporate data into a Microsoft word document. (Word/Excel 2003) When I do the mail merge and bring in the data, Excel takes a few of the data cells and adds zeroes after the decimal. I've attached a .jpg image of the screen shot during the mail merge.

For example what should have been ACTUAL WAGES 890.40 has been changed to 890.39999999998. I've tried formatting the cells as General, Text, Dollar, and using number formatting limiting it to 2 decimal places, but I still get this wierd error, and only in random cells. This is data I originally entered by hand to create the excel spreadsheet. Any ideas how to stop this? It's actually changing employees salaries!

Thank you,
Pamela

Attachments excelbug.JPG 94.82KB
pamelaanne
Newbie Poster
2 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

Questions:

- Is this happening in the Excel spreadsheet, or only in the mail-merge?

- Are these cells typed in, or calculated by formula?

- Are any macros acting on the cells?

Remember that formatting a cell does not change the value in the cell, but just how it is displayed.

One suggestion is to enter the values in those cells as text, not a number. Put an apostrophe (single quote) in front of the value, to force it to be text.

MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182
 

Hello,
It was only happening in the merge. The cells were hand entered, not calculated. I formatted the cells to text, and that fixed the problem. Unfortunately I had to go back through and reenter all the decimal values, but it was worth it to have a document that will now merge without problems.

Thanks for the help!

pamelaanne
Newbie Poster
2 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

Ok we had the same problem

If we modify the formula to { MERGEFIELD variable \# ##0,00} (depending on how many decimal you need) it works, but us we needed different numbers of decimal (0,0 0,00 0,000) because our excel field is set to "standard"

here's what we found,

{ MERGEFIELD variable } seems to be for "text fields"
{ =variable } for "numeric fields"

so we've modified in our form all numeric variable to { =variable } instead of { MERGEFIELD variable } and everything works just fine and it reflect exactly what we see in the Excel document.

ffej19
Newbie Poster
1 post since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

Here's another option. It's a spin on Midimagic's solution, but doesn't require you to retype the values as text. It's pretty adaptable too, depending on what you need.

To fix this, modify the Excel document. For example, if your data is in column C, you have your header in C1 and Cell C2 has 839.40 in it (but the merge for this record is resulting in 839.3999999999 for no apparent reason, then

Insert a column next to column C (column D), and put in this column the formula "=FIXED(C2,2). Fill down. Change the merge document to refer to this column instead of the first.

Alternately, creating the reference column as text also works. e.g. Try adding another column - column E. in the top data cell in this column put in the formula "=text(C2,"$0.00). Fill down. Change the merge document to refer to this column instead of C. The merge will then result in a currency text value, shown to two decimal places.

Attached are two files, zipped together: Sample Merge Data File 1, and Sample Mail Merge File 1. Save the zip file to your desktop, then unzip. Open the Word doc, and link to the Excel file as your data source. Scroll through the records - you'll see what I mean.

As the first column of the Excel file is randomly generated and formula driven, the answers can have many decimal places. The two columns referring to it modify the value for display in the merge document.

Attachments Sample_Mail_Merge_File_1.zip (5.52KB)
random1970
Newbie Poster
11 posts since Jun 2009
Reputation Points: 10
Solved Threads: 0
 

Hi there,

A new free product as been launched.
WordMerge allows you to merge data from your software into word templates.
With a fantastic Word Add-in so users also create templates.
Very easy to deploy.

Visit http://www.ndados.com/

Regards

fegf
Newbie Poster
1 post since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: