MS Word 2016: Mailmerge field currency formatting issue - excel

I am working on a Word document (Word 2016), which contains several mailmerge fields. One of those fields is a currency field. My data source is an Excel spreadsheet.
In the Excel spreadsheet, the field is in currency format. I am using a Greek localized currency format, which has "." for thousands separator and "," for the decimal separator. My Windows 10 regional settings are also configured this way. I want that format to appear in the Word mailmerge field. But, alas, it does not.
I have tried various formats, some of which are the following:
\# #.#,0
\# #.#,00
\# ,#.0
\# "#,#.0"
For example, when I use the first format, I get the following result:
€62,202,660,000,000,000. 0.
This is not just the wrong format. The number is actually 62202 but Word gets completely confused. The other formats I use produce similarly invalid results.
It seems that Word completely ignores my Windows system settings (which specify "," for decimal and "." for thousands) and always uses the defaults, meaning "." for decimal and "," for thousands.
How can I achieve my desired format? Why does not Word use the system settings or at least the formatting of the Excel column I use?

Related

Change decimal and thousand separator in Open XML for Excel files

I'm trying to generate an Excel file using Open XML. Sometimes I need the numeric values on each cell to be displayed with the american separator pattern - comma for thousand, dot for decimal. By default, open XML will show me those values in the portuguese pattern - dot for thousand, comma for decimal.
Is there a property in open XML that would work as if I were going to Excel Options, Advanced and changing the separators for all numeric values in the file?
Thank you.

csv format hide decimal part when is opened with excel

I have a csv file. One column has a number with 2 decimal digits like 100,00. But hides the trailing zeros (100). When I open it with notepad is 100,00.
Welcome to the mad world of CSVs and Excel.
That's one of the problems with the CSV files and excel: The value trailing zeros aren't shown by default. You can always modify the CSV within excel and then save it as *.xls or *.xlsx files.
There is no way to tell Excel to open a CSV with showing numbers per default with all given digits, if they are zero because excel does interpret them as "Standard".
If you don't need to work with the numbers as numbers you can always exchange the , with a . (that might be depending on the locale, not sure). Or just export it as a String:
The CSV:
test
="100,00"
13,37
100.00
=100,01
will produce the following output (locale de_DE):
In general, if you need to work with excel and want as much pre-formatted as possible, don't use CSV.
CSV is just comma-separated values. Just values. No formatting hints are included. So you can't have a number's display format specified within the CSV -- the numbers will be displayed in whatever format Excel shows.
If you'd rather you can change the default display format in Excel (for all sheets, not just CSV's). Not what you're asking, but perhaps it will be your preference. See How to change the default number format in Excel? for details on that option.

Uipath overdrives Excel file Locale configuration

I have to process some excel files that comes with an specific Numeric format that is es-CL
that has dots as a thousand separator and comas as decimal separator.
Thousand separator = 100.000.000
Decimal= 1.000.000,1213
When i use any of the excel activities the numbers inside the excel change their format and leaves them like this
Before: 13.640
After:13,64
the thousand separator becomes a coma and the 0 is erased.
I already tried the “Preserve Format” option, replacing the dots with a "" and i get the same result.
Is there a way to change the locale of the excel activities, if it not, what are my options?

How can I make sure Excel does not change number format of a data label in other language versions?

I have a workbook with VBA code that specifies a number format for data labels in a horizontal bar chart.
Chart.SeriesCollection(1).DataLabels.NumberFormat = "0.0"
In my copy of Excel (O365) in English, output is as expected, e.g. 3.7. When the workbook is opened in another copy of Excel (O365) in a language other than English, Excel appears to insert a backwards slash that can be seen in the Format Code -field of the Format Data Labels -sidebar (i.e. 0\.0). Where output should be e.g. 3.7, output becomes 0.4.
The issue persists when I load up the workbook after it has been touched by the non-English Excel - my version doesn't throw away the backward slash. The issue goes away when I delete the backwards slash, and output is as expected again.
It seems to me Excel treats the leading zero and decimal point as plain text and the second zero as the intended numerical character.
How can I make sure Excel maintains the number format specified in VBA when a workbook is opened in a different language version?
Don't have a direct solution, but if this persists with NumberFormat, you can programmatically use combinations of built-in Excel functions to achieve the same numbers.
for ex:
number = Round(number, 1)
In this case, you can leave the NumberFormat as "General" or something similar
It appears the easiest solution is to programmatically disable decimal separators and replace them with your own, as described here.
Application.DecimalSeparator = "."
Application.ThousandsSeparator = ","
Application.UseSystemSeparators = False
I came across this solution in this thread while searching for how to determine the language version of Excel.
Another solution is to use the decimal separator prescribed by the system when defining the number format. This solution seems to also produce the desired result (one decimal place displayed, even if 0), though with whatever decimal separator the system has defined:
Chart.SeriesCollection(1).DataLabels.NumberFormat = "0" & Application.International(xlDecimalSeparator) & "0"

Excel – locale-independent Number Format

I looking for a number format that is locale-independent.
Let's say that I want that my Excel file use an a character as a thousand separator and a b character as a decimal separator on every computer (so this question is not about local Excel settings). The second wish is that the number has always two decimal places.
Can I do this only with a number format without VB code?
After some attempts, I came to this format: ###\a###\a##0\b.00.
1234567.89 > 1a234a567b.89
The problems are:
I must repeat ###\a section and I can not get rid of dot decimal separator (the decimal places are not taken into account without the dot character).
Can I do this only with a number format without VB code?
No.
Even if you can get your separator characters inserted, you will not be able to remove the decimal separator.
The decimal separator is displayed in the cell whenever it is included in custom number display format settings.

Resources