TEXT function in different localities UK to Poland.

Darren Bartrup

Well-known Member
Joined
Mar 13, 2006
Messages
1,297
Office Version
  1. 365
Platform
  1. Windows
I have a workbook that is shared amongst colleagues in different countries on MS Teams.
When the workbook is opened in Poland the cell shows #ARG! error, while it shows #VALUE! error in the UK. Evaluating the formula results in an error, but if I edit the formula and press enter it shows ok, and evaluating works.

An example of the formula is
=TEXT($G51,"#,##0;-#,##0;0;@") & " / " & TEXT(XLOOKUP($H$3,PARawData[Date],PARawData[Inb%]),"0.00%")

G51 contains the value 11820 formatted as #,##0;-#,##0;0;@
The XLOOKUP references a cell containing the value 1 formatted as Percentage.

Does the [$-en-GB] coding only work on dates or can I add it to the start of any format? Is that even the problem?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Is the same version of Excel (i.e., 365) being used in both countries?
 
Upvote 0
Yes, we're all on 365.

Another strange thing happened, from France this time. The value 8.72 when formatted as percent should show as 872%.
The "0.00%" in the TEXT format in my formula changed it to show 8.72%. Once I recalculated it on the UK version it changed back to 872%.

So it calculated incorrectly in France and not at all in Poland. I'm confused.
 
Upvote 0
"0.00%" is probably not a valid format in countries that use a comma decimal separator.

Likewise, "#,##0;-#,##0;0;@" may also be invalid due to the commas being interpreted as decimals instead of thousands separators. Also in an array constant, it would be necessary to change semi-colons to backslashes when going from a dot / period decimal environment to comma decimal, I haven't done a test to confirm if that applies to formatting but it is a possibility.

As far as I'm aware the use of country codes in formatting is only relevant to dates (dmy or mdy order and spelling of weekdays and month names) and perhaps currency / accounting format symbols.

Probably the easiest fix would be to test a simple decimal with an error trap, then choose the correct formula for the text format based on the result. I believe that (1.1+1) would cause an error in a comma environment.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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