Abbreviate names or words
To abbreviate text that contains capital letters, you can try this array formula based on the TEXTJOIN function, a new function available in Office 365 and Excel 2019. You can use this approach to create initials from names, or to create acronyms. Only capital letters will survive this formula, so the source text must include capitalized words. You can use the PROPER function to capitalize words if needed.
In the example shown, the formula in C5 is:
How this formula works
Working from the inside out, the MID function is used to cast the string into an array of individual letters:
MID returns an array of all characters in the text.
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 63 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 63 and 90 will make into the final array, which is then reassembled with the TEXTJOIN function to create the final abbreviation or acronym.