
Tips.Net > WordTips Home > Printing > Mail Merge > Wrong Values Merged from Excel
Summary: Excel can be used as a data source for information in a Word mail merge. It is possible, however, for the values you merge to be different than what you expect. This is more than likely caused by the way in which Word merges the data. This tip covers a few things you can do to get your data just the way you want. (This tip works with Microsoft Word 2002, and Word 2003.)
Derek is performing a mail merge in Excel, but some of the values are being imported incorrectly. For instance, a value that appears as 5.2 in Excel may be imported into Word, during the merge, as 5.20000000002. Derek is wondering why this occurs.
It is important to understand that the value in Excel is more than likely 5.20000000002, but is rounded or formatted in the worksheet so that only 5.2 is displayed.
Assuming you are using Office 2002 or Office 2003, the actual merging of data from the Excel workbook is done using a technology called OLEDB. This technology, unlike the older DDE or ODBC technologies, ignores the formatting of anything that is merged. Thus, you get the full number instead of the rounded or formatted number.
There are three possible solutions to this problem. The first has to do with changing the data in your Excel worksheet. This approach will only work if the values being merged from Excel are, in fact, values and not formulaic results. In that case, simply make sure that the shorter value (5.2) is in the cell instead of the longer value (5.20000000002).
The second solution is to modify the merge field used to transfer the value to the Word document. This solution works great if the values being merged in a specific field all follow the same general pattern. For instance, let's assume that the merge field normally appears as follows:
{MergeField MyValue}
If you want the field to always display the merged value with a single digit to the right of the decimal point, you can change the field so it appears like this:
{MergeField MyValue \# ""0.x""}
The curly brackets represent the merge field braces; they are not typed. You can display your current merge field by selecting it and press Alt+F9. Then you can add the appropriate switch. You can find additional information on how to format using picture switches at this Web site:
http://www.gmayor.com/formatting_word_fields.htm
The third option is to change the way that Word actually interfaces with Excel during the merge, so that it no longer uses OLEDB. Such a change is beyond the scope of this tip, but there is a great resource page concerning it at this address:
http://homepage.swissonline.ch/cindymeister/MM2002/MM2002.htm
The page also contains quite a few other nuggets of information concerning mail merges.
Tip #330 applies to Microsoft Word versions: 2002 2003
Take Control! Master the real power behind Word! Successfully master the secrets of powerful formatting and create documents that stand out from the rest. Best of all, you can create documents that are easy to maintain and quick to change.
Check out WordTips: Sytles and Templates today!
Word includes two powerful search engines. Do you know how to use them both? You can discover new knowledge with WordTips: Find and Replace. (more information...)
Ask a Word Question
Make a Comment
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips