Rearranging a String in Alphabetic Order

Problem:

The cells in column A contain 3-letter strings.
We want to rearrange each string so that its characters are sorted in alphabetic order.

Solution:

Use the CHAR, SMALL, CODE, and MID functions as shown in the following formula:
=CHAR(SMALL(CODE(MID(A2,{1,2,3},1)),1))&CHAR(SMALL(CODE(MID(A2,{1,2,3},2)),2))&CHAR(SMALL(CODE(MID(A2,{1,2,3},3)),3))

Comments

Leave a Reply

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

Terms and Conditions of use

The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.