Jul 27 2022 06:39 AM
I have a static Excel table with records that contain boolean flags. That is, a column populated with values True and False. I wish to assure one of these two values and I hence impose a Data Validation/List on this input. The allowable list is set to "TRUE;FALSE".
This is all very basic stuff and I never thought anything of it. Today, all hell breaks loose. A colleague with a GERMAN installation has opened that database (and related downstream spreadsheets).
First observation: The Dropdown menu does not suggest the appropriate WAHR;FALSCH but remains at TRUE/FALSE.
Ok, I get it. Via Data Validation, I can only constrain pure text strings. The circumstance that my chosen text strings have a special meaning in my ENGLISH Excels is just that - circumstantial. The translation from TRUE into 1 takes place AFTER the string input "TRUE" has been validated.
I also get the fix. I must create a short static spreadsheet range somewhere which contains the values TRUE and FALSE which I shall call TRUEFALSE and can refer to as thus in the Data Validation. All things being well, Excel should then translate the values in that range into the local language and the Dropdown menu will be good.
(This is amazing of itself, since one might just as well expect this approach to yield a Dropdown menu of 1 and 0. But I checked - we get the strings.)
But things are a lot wackier still. In theory, my colleague should only have seen values WAHR and FALSCH in his (translated) view of my spreadsheet. But no, SOME values come through as TRUE and FALSE, ie Excel will not translate them.
We cannot make out any rhyme or reason. There is no difference between those English cells and all the German ones. Anyone ever observed anything like it? We are talking here about O365, latest versions.
In case the far-reaching significance of this problem is lost, where my English Excel subsequently evaluates =IF(Flag;...;...), his Excel returns #WERT because =WENN("True";...;...) means absolutely nothing to his German Excel.
(Now alerted to this issue, we observe the same problem in Italy and in Spain. Extraordinary.)
Jul 27 2022 08:40 AM
@ecovonrein Not sure I follow, but I suggest you try to create your dropdown list based on two cells with formulas =TRUE and =FALSE, rather than texts "TRUE" and "FALSE". The formulas should translate to any language supported by Excel. Can't test it though as I only use the English version. See attached and try.
Jul 27 2022 08:48 AM
Jul 27 2022 08:56 AM - edited Jul 27 2022 09:00 AM
Update: The investigation gets weirder by the minute. I skipped a few details in the post above, one being that the flag was also passed thru some VBA code. I could not understand why the VBA code did not puke. And I just ran a test on a German computer:
Public Function haveFun(flag as Variant) as Variant
if flag then
haveFun = "Hello"
else
haveFun = "world"
End Function
I can call =haveFun(WAHR) or =haveFun(TRUE) and get "Hello" in both cases. That is, VBA is indifferent to the input language used.
Do the same thing in native Excel - =if(C5;"Hello";"world") - and we get #WERT! when C5 contains TRUE.
Extraordinary.
I am looking at multiplying the VBA input *1 to assure symmetric behaviour. TRUE*1 blows up in German Excel.
Jul 27 2022 09:56 AM - edited Jul 27 2022 10:01 AM
And reflecting on this some more, it is actually the return value from a VBA function that popped up as "TRUE" in the German Excel and prompted a #WERT! in a downstream WENN. There is nothing I can do to turn that into WAHR. The VBA code handles a Boolean throughout. So I might guess that there is a bug in the German Excel which does not translate a Boolean into WAHR/FALSCH but merrily returns TRUE/FALSE.
So, while there appear to be unrelated problems of translation of boolean values, the bigger problem with VBA I cannot solve. My best solution will likely be to steer clear of TRUE/FALSE altogether use only 0 and 1 going forward. Ouch.
Jul 28 2022 12:58 AM - edited Jul 28 2022 01:00 AM
Reflected on yesterday's disaster overnight and believe to understand the origins of the problem. Let's bear in mind a few truths about Excel:
This analysis explains the odd records that will not translate. No records are ever translated. It is just that most records hold a Variant/Boolean that must be rendered (in the local language), while others are Variant/String (that are displayed as stored).
PS: None of this explains why a VBA function that returns a Variant/Boolean renders to "TRUE" in a German Excel. Or why a German VBA is happy to type-cast "TRUE" into a Variant/Boolean.