I would like to split all words in my cell by Uppercase, an example:
Original values:
MikeJones
RinaJonesJunior
MichealSamuelsLurth
Expected output:
Mike Jones
Rina Jones Junior
Micheal Samuels Lurth
Can this be done without using VBA?
I would like to split all words in my cell by Uppercase, an example:
Original values:
MikeJones
RinaJonesJunior
MichealSamuelsLurth
Expected output:
Mike Jones
Rina Jones Junior
Micheal Samuels Lurth
Can this be done without using VBA?
Since you say you would not like to use a VBA macro, but the problem requires VBA, I think a UDF will be a nice solution for you. This is a UDF (User defined Function) that you can use. Put this code in a general module of the same file that you have the data in.
You can now use the function directly in a cell. Suppose you have data in A1 -> "MikeJones" And you want answer in cell A2. So in A2, you enter
And you will get your output. HTH.
Here's a worksheet function solution. It ain't pretty, but if you're totally averse to using VBA, then I think you're stuck with ugly options only. For text in
A1
, paste the following intoB1
and press Ctrl+Shift+Enter to enter the formula as an array formula:I told you it was ugly!
And for all that effort, that will only split the first and second name. For more splits, fill the formula over to the right. So for example, if you have a list of names in
A1:A10
, and you think the most words in any name is four, you could enter the formula inB1
(as an array formula!), fill down toB10
, then fill right toE10
. Your list of split names will be inE1:E10
.If you're inclined to jump down the rabbit hole, here's a brief explanation of what the formula does:
Having acknowledged Excellll's remarkable formula, the most efficient code solution would be
RegExp
based. This avoids long loops.This would work as a user defined function.
you have to do this with VBA.