Within Excel I use the LEN() and MID() functions for a similar scenario with non-fixed string lengths, but in your case I believe it would be much easier to work with an array.
Best of luck and have a nice day as well.