In the example shown, the formula in C5 is: In this part of the formula, MID, ROW, INDIRECT, and LEN are used to convert a string to an array or letters, as described here. MID returns an array of all characters in the text. {“W”;“i”;“l”;“l”;“i”;“a”;“m”;" “;“S”;“h”;“a”;“k”;“e”;“s”;“p”;“e”;“a”;“r”;“e”} This array is fed into the CODE function, which outputs an array of numeric ascii codes, one for each letter. Separately, ROW and INDIRECT are used to create another numeric array: This is the clever bit. The numbers 65 to 90 correspond to the ascii codes for all capital letters between A-Z. This array goes into the MATCH function as the lookup array, and the original array of ascii codes is provided as the lookup value. MATCH then returns either a number (based on a position) or the #N/A error. Numbers represent capital letters, so the ISNUMBER function is used together with the IF function to filter results. Only characters whose ascii code is between 65 and 90 will make into the final array, which is then reassembled with the TEXTJOIN function to create the final abbreviation or acronym.
Dave Bruns
Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.