Quick Links

Who knew that Microsoft Excel could act as a translator? Through Microsoft Translate Services, Excel can translate from one language to another (the TRANSLATE function) and detect another language already in a workbook (the DETECTLANGUAGE function).

You will only see these language functions (added in December 2024) if you’re using the Excel Windows or Mac desktop app as a Microsoft 365 subscriber, Excel for the web, or the Excel mobile app.

Remove Ads

What Are the Syntaxes?

Before I show you some examples of each function in action, here are their syntaxes.

TRANSLATE

The TRANSLATE function has three arguments:

=TRANSLATE(a,b,c)

where

  • a (required) is either the text to translate (embedded in double quotes), or a reference to the cell containing the text to translate.
  • b (optional) is the source language code in double quotes (see the Language Codes section below). If you omit this argument, Excel will try to detect the language automatically. Although this is an optional argument, it’s best to include it (if you know the language and its code) to ensure an accurate translation.
  • c (optional) is the target language in double quotes. If you skip this argument, Excel will use your system language as the target language. However, again, try to add a target language code for better translation outcomes.

If you don’t place the language code within double quotes, Excel will return the #NAME? error.

Remove Ads

DETECTLANGUAGE

This function is much more straightforward, requiring only one argument:

=DETECTLANGUAGE(x)

where

  • x is either the text to detect, embedded within double quotes, or a reference to the cell containing the text to detect.

Language Codes

Here are some of the language codes from Microsoft’s longer list of codes. Remember that all language codes in your formula must be in double quotes.

Code

Language

“en”

English

“es”

Spanish

“fr”

French

“de”

German

“zh-chs”

Mandarin (simplified)

“ru”

Russian

“ar”

Arabic

Remove Ads

Examples of TRANSLATE in Action

Let me show you the TRANSLATE function using two real-world examples. The first is a basic translation of several cells in Excel, while the second example shows you how to use the TRANSLATE function dynamically with a drop-down list.

Example 1: Translating Text in Cells

Let’s say you have a vehicle expenses form, and you want to translate the form’s title, totals section, and table headers from English into Spanish.

A vehicle expenses form in Excel, with spaces left for translations of each field name into Spanish.

Starting in cell C2, type:

=TRANSLATE(A1,"en","es")

and press Enter.

Vehicle Expenses Form translated into Spanish in Excel using the TRANSLATE function.
Remove Ads

Now, use the format painter tool to apply the formatting of the English title to the Spanish title. You can also apply a red font to distinguish between the two languages.

Vehicle Expenses Form translated into Spanish in Excel using the TRANSLATE function, and the formatting amended to distinguish the two languages.

You’re now ready to translate the next section of the form. First, select cell C1, and select and copy (Ctrl+C) the formula in the formula bar.

Cell C1 in Excel, which contains the TRANSLATE function, is activated, and the formula in the formula bar is selected and copied.

Now, select cell B3, paste (Ctrl+V) the copied formula into the formula bar, and change the first argument to reference cell A3, before pressing Enter.

The first argument in the TRANSLATE function in Excel is changed from A1 to A3.
Remove Ads

Now, use the fill handle to apply the same relative formula to cells B4 to B6.

An arrow indicating the direction in which Excel's fill handle should be clicked and dragged from cell B3 to apply the TRANSLATE function to other cells.

To finish this section, copy and paste the formula into cell E3, and use the fill handle again.

An Excel sheet containing information field titles that are translated from English to Spanish using the TRANSLATE function.

Because some of the Spanish translations contain more characters than their English counterparts, adjust the font sizes (or, if you prefer, the column widths) so that they fit nicely into their respective cells. Remember to also change the font colors to red for consistency.

Remove Ads
An Excel sheet containing information field titles translated from English to Spanish using the TRANSLATE function and formatted in a red font.

Finally, follow the same process to translate your table headers.

A vehicle expenses form in Excel containing field names in English and Spanish, achieved by using the TRANSLATE function.

Example 2: Selecting a Translating Language From a Drop-Down List

This survey contains some questions that the respondent needs to fill in. Your aim is to create a drop-down list of languages so that the respondent can choose the language in which they want to see the questions.

A survey in Microsoft Excel, with spaces where translations of the questions will appear.
Remove Ads

The first step is to create the list of available languages. Let’s say you want to offer Spanish, French, and Arabic as the options. Open Sheet 2 using the tabs at the bottom of your Excel window. Then, type each of those languages into separate rows in column A and their corresponding codes in column B.

Because you’re going to refer to the cells containing these language codes, rather than type them directly into your formula, you don’t need to embed them within double quotes.

An Excel sheet containing the words Spanish, French, and Arabic in cells A1 to A3, and their respective language codes in column B.

Now, in cell C1, type:

=TRANSLATE(A1,"en",B1)

Press Enter, and then use the fill handle to populate the remaining rows.

An Excel sheet containing the names of three languages in English, their language codes, and their translations into their respective languages.-1
Remove Ads

It’s now time to create the drop-down list in Sheet 1. Select the cell where the drop-down will go, click the “Data Validation” drop-down icon in the Data tab, and select “Data Validation.”

Cell B1 is selected in Excel, and the Data Validation option is selected via the Data tab on the ribbon.

Select “List” in the Allow field, and after placing your cursor in the Source field, select the three cells containing the translations of the chosen languages (cells C1 to C3 in Sheet 2).

The Data Validation window in Excel, with 'List' selected in the Allow field, and cells C1 to C3 in Sheet 2 selected in the Source field.

When you click “OK,” you’ll see a drop-down list appear at the top of your survey, which, when clicked, displays the words Spanish, French, and Arabic in their respective languages.

Remove Ads
Cell B2 in an Excel sheet contains a drop-down option which, when activated, displays the words Spanish, French, and Arabic in their respective languages.

To prepare your spreadsheet for the final step, select one of the languages from this list.

You’re now ready to translate your questions into the selected language. In cell B3, type (or copy and paste) the following formula:

=TRANSLATE(A3,"en",XLOOKUP($B$1,Sheet2!$C$1:$C$3,Sheet2!$B$1:$B$3))

where

  • A3 is the cell containing the text you want to translate (the survey question),
  • “en” is the source language of that text, and
  • the third argument is an XLOOKUP formula that takes the selected language, looks for that in your table in Sheet 2, and returns the language code.

Notice how, in the third argument, I have
used dollar symbols ($) in each of the references to lock their positions
. If you fail to do this, when you apply the formula to other cells, the formula will act relatively, meaning it will not work as you hoped.

Remove Ads

When you press Enter, the first question translates into the language you selected from the drop-down list earlier. Then, use the fill handle to apply the formula to the remaining questions in your survey.

A list of questions in a survey in Excel translated to a language selected from a drop-down list in cell B2.

Reduce the font size slightly in cells B3 to B7 to account for the fact that some translations may contain more characters than the questions in English.

Finally, change the language in your drop-down menu to see the translations magically change accordingly!

A list of questions in a survey in Excel translated to Arabic.
Remove Ads

An Example of DETECTLANGUAGE in Action

If your spreadsheet contains data in many languages, you might find it useful to use Excel’s DETECTLANGUAGE function.

Suppose you have received this spreadsheet containing three non-English sentences in cells A1 to A3, and you want Excel to identify their languages.

An Excel sheet containing three foreign-language sentences in cells A1 to A3.

In cell B1, type:

=DETECTLANGUAGE(A1)

and press Enter. Then, use the fill handle to copy this formula to cells B2 and B3.

An Excel sheet containing the names of three languages in English, their language codes, and their translations into their respective languages.-2

Column B now contains the language codes for each of these sentences. If you’re unsure what these codes represent, you can see the full list on Microsoft’s translator language support page.

Remove Ads

As well as translating in Excel, you can also translate text in a Microsoft Word document. To translate a section of a file, select the relevant text, and click Review > Translate > Translate Selection. This opens the Translator pane, where you can choose a target language. Alternatively, to open a translated copy of a whole document, click Review > Translate > Translate Document.