Hey everyone, did you know that Microsoft Excel, the program we all use for handling data, can also translate languages and figure out what language you’re using?
It’s true! The TRANSLATE
and DETECTLANGUAGE
functions were added in December 2024 and are available in the desktop versions for Windows and Mac, the mobile app for Microsoft 365 users, and the web version. Let’s check out how to use them.
Using the TRANSLATE Function
This function lets you translate text directly within your Excel sheet.
Here’s the basic structure of the TRANSLATE
function: =TRANSLATE(a, b, c)
.
a
: This is the text you want to translate. You can put the text directly in quotes or reference a cell containing the text.b
: This is the code for the original language of the text. It’s optional, and if you leave it out, Excel will try to detect it automatically. But, if you know the language code it’s best to include it for a more accurate translation.c
: This is the code for the language you want to translate the text to. If you skip this, Excel will use your system’s language, but it’s better to include it for accuracy.
Note: Remember to put language codes inside double quotes; otherwise, you’ll get a
#NAME?
error.
Using the DETECTLANGUAGE Function
This function is helpful if you’re working with text and are not sure of its language.
The DETECTLANGUAGE
function has only one argument: =DETECTLANGUAGE(x)
. Here, x
can either be the text (in quotes) or a cell reference containing the text.
To use these functions, you need to know the language codes. English is en
, Russian is ru
, Spanish is es
, and French is fr
. You can find a full list of codes on Microsoft’s website.
How to Use the Translate Function
- Open your Excel sheet and paste the text you want to translate into a cell. For our example, we’ll paste it into cell A2.
- Go to another cell where you want the translation and start typing
=TRANSLATE(
.
- Now, enter the cell address of your original text, which is A2 in our case. Then, add a comma, followed by the source language code in double quotes, like
"es"
for Spanish.
- Add another comma, then type the target language code, such as
"en"
for English, in double quotes, and close the parentheses.
- Press Enter, and Excel should give you the translation.
How to Use the Detect Language Function
The DETECTLANGUAGE function helps you identify the language code for text in a cell.
- Open an Excel worksheet, and paste the text you want to identify the language of into a cell.
- Go to another cell and type
=DETECTLANGUAGE(
.
- Add the cell address that contains the text.
- Press Enter, and Excel will show you the language code. For example, for Spanish it will display
es
.
Making Translations Dynamic
You can make your translations more interactive with dropdown menus.
- Create a new sheet (click the ‘+’ button at the bottom).
- In this sheet, list the languages in Column A, each on a different row, and their corresponding language codes in Column B.
- In Cell C1 type
=TRANSLATE(A1,"en",B1)
and press enter, then drag the small square at the bottom right of C1 down to fill all cells below with the translated text.
- Go back to your original sheet (Sheet 1), select a cell where you want the dropdown, go to the ‘Data’ tab, and click ‘Data Validation’.
- In the ‘Data Validation’ dialog, choose ‘List’ from the ‘Allow’ dropdown.
- In the ‘Source’ field, select the language options in Sheet 2. Click ‘OK’, and you’ll have a dropdown in the cell you picked.
- You can use the following formula, modified to match your setup, to link the TRANSLATE function with the dropdown. Here’s the formula:
=TRANSLATE(A3,"en",XLOOKUP($B$1,Sheet2!$C$1:$C$3,Sheet2!$B$1:$B$3))
Note: Be sure to use the
$
signs to keep the references fixed. Missing this will change the reference when you drag the formula to other cells, making the formula ineffective.
Other Things to Keep in Mind
- These functions are recent additions, so they might not be available in your version yet.
- Different languages have different character counts, which can affect formatting. You may need to adjust fonts to keep your worksheet clean.
- If you get “Text too long,” reduce the text or cell size. If you see “Error in value,” remove any non-text data in the cell. If there’s an “Invalid language” error, make sure the language code is correct.
- The
TRANSLATE
andDETECTLANGUAGE
functions need an internet connection as they rely on Microsoft’s translation services, and you may experience throttling if you exceed your daily request quota.