Skip to content

Locale Profiles ​

Excel behavior is not fully locale-neutral. Function names, separators, date parsing, width handling, currency, and text behavior can vary by platform and locale. Formulon therefore exposes named profiles instead of a single global compatibility mode.

Glossary: compatibility profile

A named binding between an Excel 365 host and a locale, plus the oracle data that supports the compatibility claim. The profile drives locale-sensitive evaluation; applications and tests pin to a profile explicitly rather than relying on host-OS defaults.

Profiles today ​

Formulon ships 28 profile IDs: {mac,win}-365-{ja_JP,en_US,de_DE,fr_FR,zh_CN,ko_KR,th_TH,es_ES,es_MX,pt_BR,ru_RU,zh_TW,it_IT,nl_NL}. A new workbook uses win-365-en_US unless the application selects another profile. createForProfile(profileId) also gives the new workbook the fonts, style names, and sheet names Excel uses in that locale; see Workbook lifecycle.

HostProfilesMeasurement status
Mac Excel 365mac-365- followed by all 14 locale codesAll 14 are measured. mac-365-ja_JP is the primary formula and conditional-formatting oracle; the other 13 locales have their own formula goldens.
Windows Microsoft 365win-365- followed by all 14 locale codeswin-365-ja_JP is measured and is the workbook (PivotTable and print) oracle. The other 13 Windows profiles are estimates until a Windows capture replaces them.

localeFacts(profileId) exposes two measurement flags. measured describes the scalar locale facts; collationMeasured describes text ordering separately. The latter is true for all Mac profiles and false for every Windows profile, including win-365-ja_JP. Neither flag says whether a particular formula is implemented. Python uses collation_measured; the C record uses the same snake-case field.

Locale facts ​

The following values are the current localeFacts() data. The array column is (column separator, row separator). Currency prefix / suffix describes the symbol position; space means one space is emitted between the symbol and the number. These scalar facts are shared by the Mac and Windows profile for a locale; the measured flag differs as described above.

LocaleDecimalGroupListArrayBoolean namesDate orderCurrency
ja_JP.,,, ;TRUE / FALSEymd¥, prefix, 0 decimals
en_US.,,, ;TRUE / FALSEmdy$, prefix, 2 decimals
de_DE,.;. ;WAHR / FALSCHdmy€, suffix, space, 2 decimals
fr_FR,space;. ;VRAI / FAUXdmy€, suffix, space, 2 decimals
zh_CN.,,, ;TRUE / FALSEymd¥, prefix, 2 decimals
ko_KR.,,, ;TRUE / FALSEymd₩, prefix, 0 decimals
th_TH.,,, ;TRUE / FALSEdmy฿, prefix, 2 decimals
es_ES,.;\ ;VERDADERO / FALSOdmy€, suffix, space, 2 decimals
es_MX.,,, ;VERDADERO / FALSOdmy$, prefix, 2 decimals
pt_BR,.;\ ;VERDADEIRO / FALSOdmyR$, prefix, space, 2 decimals
ru_RU,space;; :ИСТИНА / ЛОЖЬdmy₽, suffix, space, 2 decimals
zh_TW.,,, ;TRUE / FALSEymd$, prefix, 2 decimals
it_IT,.;\ .VERO / FALSOdmy€, suffix, space, 2 decimals
nl_NL,.;\ ;WAAR / ONWAARdmy€, prefix, space, 2 decimals

localeFacts() also exposes localized error names. The profile controls R1C1 letters, date and time names, and TEXT() format rules internally, but those fields are not part of the public LocaleFacts result. Do not infer any of them from the currency or separator table.

Code pages and width rules ​

The locale profile also selects the code-page behavior of byte-counting and character-code functions. DbcsCodepage is the double-byte page used by LENB, LEFTB, RIGHTB, MIDB, CHAR, and CODE; the CHAR / CODE single-byte page is listed separately.

LocaleDBCS pageCHAR / CODE byte pageWidth folding
ja_JPJIS X 0208CP932Mac rules on mac-*; Windows rules on win-*
zh_CNGB2312DBCS high bytes are blanknone
ko_KRKS X 1001DBCS high bytes are blankMac rules on mac-*; Windows rules on win-*
zh_TWBig5DBCS high bytes are blanknone
Other localesnoneMacRoman on mac-*; Windows-1252 on win-*, except th_TH and ru_RUMac rules on mac-*; Windows rules on win-*

For th_TH, the byte page is MacThai; for ru_RU, it is MacCyrillic. These are profile facts even on the corresponding win-* IDs. Chinese profiles keep width and kana distinctions in the paths where the source collator says they are distinct; the exact function strength is covered in Text collation.

Pivot labels ​

Pivot captions are also profile data. ␠ below marks the trailing space present in the stored prefix. grand total is the ordinary total caption and hierarchy total is the hierarchy caption returned by localeFacts().

LocaleGrand totalHierarchy totalRow prefixColumn prefixValue prefix
ja_JP合計総計行フィールド␠列フィールド␠値␠
en_USTotalGrand TotalRow Field␠Column Field␠Value␠
de_DEGesamtGesamtergebnisZeilenfeld␠Spaltenfeld␠Wert␠
fr_FRTotalTotal généralChamp de ligne␠Champ de colonne␠Valeur␠
zh_CN总计总计行字段␠列字段␠值␠
ko_KR합계총합계행 필드␠열 필드␠값␠
th_THผลรวมผลรวมทั้งหมดเขตข้อมูลแถว␠เขตข้อมูลคอลัมน์␠ค่า␠
es_ES, es_MXTotalTotal generalCampo de fila␠Campo de columna␠Valor␠
pt_BRTotalTotal GeralCampo de linha␠Campo de coluna␠Valor␠
ru_RUИтогоОбщий итогПоле строки␠Поле столбца␠Значение␠
zh_TW總計總計列欄位␠欄欄位␠值␠
it_ITTotaleTotale complessivoCampo riga␠Campo colonna␠Valore␠
nl_NLTotaalEindtotaalRijveld␠Kolomveld␠Waarde␠

How a profile affects evaluation ​

The profile-controlled areas include:

  • number, boolean, and error text and parsing: decimal and thousands separators, localized TRUE / FALSE names, and date order;
  • TEXT() format letters, keywords, color names, and month and day names;
  • text comparison, sorting, lookup, grouping, and coercion, including width and kana handling;
  • R1C1 reference letters and CELL() codes;
  • FORMULATEXT() function names and separators, including localized aliases where Excel has them;
  • DBCS code pages and the single-byte CHAR() / CODE() pages;
  • GROUPBY() / PIVOTBY() labels;
  • environment-sensitive INFO() values;
  • sheet-name rules: History in any case is refused on add and rename under win-* profiles and accepted under mac-*; and
  • PivotTable labels and layout defaults.

Formulas are stored with English function names and invariant separators. The profile changes how formula text is interpreted and how results are rendered; it does not change the stored formula syntax. functionMetadata(name) is locale-invariant and returns structural metadata. Use the profile-aware localization methods when the user-facing function name or formula text must change. The workbook language guide covers that boundary and the cell language-switching guide covers editor behavior.

Do not silently switch profiles

A workbook recalculated under a different profile can produce different results even when the formulas look the same. Persist the profile targeted by the application and assert it at startup.

Selecting and persisting a profile ​

Through the JavaScript bindings:

ts
const selected = 'mac-365-de_DE'
const status = wb.setExcelProfileId(selected)
if (!status.ok) throw new Error(status.message)
const profile = wb.excelProfileId()
if (!profile.status.ok) throw new Error(profile.status.message)
console.log(profile.value) // mac-365-de_DE
wb.recalc()
python
selected = "mac-365-de_DE"
wb.set_excel_profile_id(selected)
print(wb.excel_profile_id())  # mac-365-de_DE
wb.recalc()

The profile belongs to the workbook instance, not to a process-wide flag, so different workbooks in one process can target different profiles. The profile is not serialized into an XLSX or XLSB file. Persist the selected ID in application state and apply it again after loading. Changing the profile marks formulas dirty; call recalc() before reading values.

Source facts are defined by src/excel_profile.h, src/excel_locale.h, src/excel_locale.cpp, and the locale and collation oracle fixtures in the Formulon source tree.