Text functions

DETECTLANGUAGE

Deferred: needs an outside service

Deferred by policy: the answer needs Microsoft's language service. DNA Calc does not run this function yet. How we measure this

Local names in 40 languages
LanguageName in Excel
ArabicDETECTLANGUAGE
BulgarianDETECTLANGUAGE
CzechDETEKOVATJAZYK
DanishREGISTRERSPROG
GermanDETECTLANGUAGE
GreekDETECTLANGUAGE
English (Australia)DETECTLANGUAGE
English (United Kingdom)DETECTLANGUAGE
English (United States)DETECTLANGUAGE
SpanishDETECTARIDIOMA
EstonianDETECTLANGUAGE
FinnishTUNNISTAKIELI
FrenchDÉTECTERLANGUE
HebrewDETECTLANGUAGE
CroatianDETECTLANGUAGE
HungarianNYELVFELISMERÉS
IndonesianDETECTLANGUAGE
ItalianDETECTLANGUAGE
JapaneseDETECTLANGUAGE
KoreanDETECTLANGUAGE
LithuanianDETECTLANGUAGE
LatvianDETECTLANGUAGE
NorwegianDETECTLANGUAGE
DutchTAALDETECTEREN
PolishWYKRYJJĘZYK
Portuguese (Brazil)DETECTLANGUAGE
Portuguese (Portugal)DETETARIDIOMA
RomanianDETECTLANGUAGE
RussianОПРЕДЕЛИТЬЯЗЫК
SlovakDETECTLANGUAGE
SlovenianDETECTLANGUAGE
Serbian (Latin)DETECTLANGUAGE
SwedishIDENTIFIERASPRÅK
ThaiDETECTLANGUAGE
TurkishDİLİALGILA
UkrainianDETECTLANGUAGE
VietnameseDETECTLANGUAGE
Chinese (Simplified)DETECTLANGUAGE
Chinese (Hong Kong)DETECTLANGUAGE
Chinese (Traditional)DETECTLANGUAGE

Names from Microsoft's support site.

What it does

DETECTLANGUAGE(text)

DETECTLANGUAGE asks Microsoft Translation Services which language some text is in, and returns a language code such as es. It returns a code, not a language name.

DETECTLANGUAGE(text) takes text, or a reference to cells holding text.

=DETECTLANGUAGE("Hola mundo!")

Try it

DNA Calc does not run this function yet: its answer needs an outside service. In Excel you would write:

=DETECTLANGUAGE("Hello world")

Quirks

  • One answer, no confidence. There is no score, so an ambiguous word gets a definite-looking code.
  • Answers may change. Microsoft calls this a service-backed function, whose languages can change over time.
  • Numbers are not read as text. Microsoft describes a non-text value as an error, unlike the ordinary conversion of numbers to text.
  • Undocumented cases: empty text, mixed-language text, and whether a multi-cell reference spills.

When the service is unavailable

Microsoft documents three failure messages:

MessageMeaning
Text Too LongThe cell holds too many characters; no figure is given
Error in ValueThe input is not text
Request ThrottledThe daily quota is used up; no figure is given

The page does not say what appears with no connection. This has not been measured here.

How to implement

DNA Calc does not run this function yet. It is deferred by policy, because the answer depends on a back end Microsoft hosts and controls. An implementation needs:

  1. A language classifier. Another model will disagree on short and mixed text, so it cannot promise Excel's answers.
  2. The code vocabulary of the service, kept current.
  3. Asynchronous calculation with caching, and the documented failures.
  4. Measured argument rules: non-text values, empty text and multi-cell references.

Rust code

This entry has no Rust implementation yet.

No implementation has been published with a Handbook test suite for this function.

Version differences

No Excel answers for this function are recorded here, so no comparison between Excel builds exists. Microsoft's page lists Excel for Microsoft 365 on Windows and Mac and Excel Mobile. Service updates can change answers with no Excel build changing.

Alternatives

  • TRANSLATE with source_language omitted, when only the translation matters.
  • A column of known language codes, when the source of the text is known.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents