Forum Discussion

xen900's avatar
xen900
Copper Contributor
Jul 15, 2022
Solved

Excel - Need to split variable length names and dates

My issue is that I need to split names and dates that are all in the same column, but names are not always First / Last with a date. I need to be able to incorporate the solution into a macro. I am n...
  • HansVogelaar's avatar
    Jul 15, 2022

    xen900 

    Let's say the values are in A2 and down.

    In B2:

    =TRIM(LEFT(SUBSTITUTE(A2," ",REPT(" ",255),LEN(A2)-LEN(SUBSTITUTE(A2," ",""))-4),255))

    In C2:

    =TRIM(MID(SUBSTITUTE(A2," ",REPT(" ",255),LEN(A2)-LEN(SUBSTITUTE(A2," ",""))-4),255,255))

    Fill down.

Resources