Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • How to get address of last cell in range in Excel
  • To count total rows in a range in Excel
  • LOOKUP function: Description, Usage, Syntax, Examples and Explanation
  • Two-way lookup with VLOOKUP in Excel
  • Basic INDEX MATCH approximate in Excel

Data Analysis Examples

  • How to Create Thermometer Chart in Excel
  • How to calculate average last N values in a table in Excel
  • Move chart to a separate worksheet in Excel
  • Working With Tables in Excel
  • How to Create Gantt Chart in Excel

Data Validation Examples

  • Prevent invalid data entering in specific cells
  • Excel Data validation unique values only
  • Excel Data validation must not contain
  • Excel Data validation whole percentage only
  • Excel Data validation date in specific year

How to translate letters to numbers in Excel

by

To translate letters in a string to numbers, you can use an array formula based on the TEXTJOIN and VLOOKUP functions, with a defined translation table to provide the necessary lookups.

Formula

{=TEXTJOIN("",1,VLOOKUP(T(IF(1,MID(A1,ROW
(INDIRECT("1:"&LEN(A1))),1))),xtable,2,0))}

Explanation

In the example shown, the formula in C5 is:

{=TEXTJOIN("",1,VLOOKUP(T(IF(1,MID(B5,ROW
(INDIRECT("1:"&LEN(B5))),1))),xtable,2,0))}

where “xtable” is the named range E5:F10.

Note: this is an array formula and must be entered with control + shift + enter.

How this formula works

At the core, this formula uses an array operation to generate an array of letters from the input text, translates each letter individually to a number, then joins all numbers together again and returns the output as a string.

Worked Example:   Convert date string to date time in Excel

To parse the input string into an array or letters, we use MID, ROW, LEN and INDIRECT functions like this:

MID(B5,ROW(INDIRECT("1:"&LEN(B5))),1)

LEN returns the length of the input text, which is concatenated to “1:” and handed off to INDIRECT as text. INDIRECT evaluates the text as a row reference, and the ROW function returns an array of numbers to MID:

MID(B5,{1;2;3},1)

MID then extracts one character for at each starting position and we have:

=TEXTJOIN("",1,VLOOKUP(T(IF(1,{"a";"b";"c"})),xtable,2,0))

Essentially, we are asking VLOOKUP to find a match for “a”, “b”, and “c” at the same time. For obscure reasons, we need to “dereference” this array in a particular way using both the T and IF functions. After VLOOKUP runs, we have:

=TEXTJOIN("",1,{9;4;6})

and TEXTJOIN returns the string “946”. If you need a number as final result, add zero. The math operation will coerce the text into a number.

Worked Example:   VLOOKUP from another sheet in Excel

Note: the TEXTJOIN function was introduced via the Office 365 subscription program in 2018.

Worked Example:   Multiple chained VLOOKUPs in Excel

Post navigation

Previous Post:

How to calculate annual compound interest schedule in Excel

Next Post:

How to strip numeric characters from cell in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others
  • How to create email address with name and domain in Excel
  • Remove leading and trailing spaces from text in one or more cells in Excel
  • Get first name from full name — Manipulating NAMES in Excel
  • CHAR function: Description, Usage, Syntax, Examples and Explanation
  • How to calculate Number of Instances in Excel
  • Add workdays no weekends in Excel
  • Extract time from a date and time in Excel
  • List holidays between two dates in Excel
  • DATEVALUE function: Description, Usage, Syntax, Examples and Explanation
  • Calculate series of dates by workdays in Excel
  • DOLLARDE function: Description, Usage, Syntax, Examples and Explanation
  • AMORLINC function: Description, Usage, Syntax, Examples and Explanation
  • Example of payment for annuity in Excel
  • IRR function: Description, Usage, Syntax, Examples and Explanation
  • How to set check register balance in Excel
Acronyms, Abbreviations, Initialism & What They Stand For
© 2021 xlsoffice. All Rights Reserved | Teal Smiles