A to Z of Excel Functions: The DETECTLANGUAGE Function
5 August 2024
Welcome back to our regular A to Z of Excel Functions blog. Today we look at the DETECTLANGUAGE function.
The DETECTLANGUAGE function
Currently in Preview, you should be careful using this function: its signature and results may change substantially before being broadly released, based upon feedback from those fortunate enough to be able to access them. Therefore, we strongly recommend you do not rely on this function in important workbooks until it is Generally Available.
DETECTLANGUAGE detects the language of text you provide using the Microsoft Translation Services and returns the language code. The full signature is:
DETECTLANGUAGE(text)
The function has the following arguments:
- text: the text or reference to cells containing text to evaluate.
Currently, there are 133 languages supported – including two variations of Klingon!!
The supported languages and their respective language codes are as follows:
Suppose you have the following text in cell A1: "Hola mundo!" and you want to find out what the language of the text is. You can use the DETECTLANGUAGE function as follows:
=DETECTLANGUAGE(A1)
This will return the detected language for the text in cell A1. The language code "es" for Spanish will be displayed in the cell where you entered the formula.
Alternatively, you may just type the text in, viz.
Common errors include the following:
- Text Too Long: you have too many characters in a cell. Reduce your cell size and try again
- Error in Value: you have a non-text value in your cell. The function only accepts a text argument
- Invalid Language: you have entered an invalid language code or one not presently supported (see above)
- Request Throttled: you have exceeded your daily quota of the translation function.
These functions are currently available to Beta Channel users running:
- Windows: Version 2407 (Build 16.0.17808.20000) or later
- Mac: 16.87 (Build 24062430) or later.
We’ll continue our A to Z of Excel Functions soon. Keep checking back – there’s a new blog post every business day. A full page of the function articles can be found here.