Extracting Name from Cell with Date and Name Data

Jessrozy11

New Member
Joined
Mar 1, 2019
Messages
6
Hi,

I have a cell that has date and name (last name, first name):
01/27/2019-Gxxxxxxx, Txxxxx
01/26/2019-Kxxxxxxx, Exxx
01/02/2019-Mxxxx, Axxxxxxx
01/27/2019-Gxxxxxxx, Txxxxx

<tbody>
</tbody>

I need to remove the date and only see the name and preferably in the opposite order. Right now it is showing last name, first name. Prefer first name last name.

I'd like to see data as:
Txxxxx Gxxxxxxx
Exxx Kxxxxxxx
Axxxxxxx Mxxxx
Txxxxx Gxxxxxxx

I tried =MID($A2, 12, 30) but I’m worried the date format may come through as 01/2/2019 for the single digit days. I also wasn’t able to figure out how to switch the name order either. Is there an easier way or different formula I can use?

Greatly appreciated!
Jessica
 
Adding the TRIM function didn't work but I think I'll be ok. This was great assistance! Thank you all!
You may have some special characters in there, like non-breaking spaces or other things that the TRIM function does not work on.
That is very common with data that comes from other sources (especially the web).
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi,

Try and see if this works for you, will remove "non-breaking" and normal spaces:


Book1
AB
101/27/2019-Gxxxxxxx, TxxxxxTxxxxx Gxxxxxxx
201/26/2019-Kxxxxxxx, ExxxExxx Kxxxxxxx
301/02/2019-Mxxxx, AxxxxxxxAxxxxxxx Mxxxx
401/27/2019-Gxxxxxxx, TxxxxxTxxxxx Gxxxxxxx
Sheet621
Cell Formulas
RangeFormula
B1=TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(MID(A1,FIND(",",A1)+1,99)&" "&MID(A1,FIND("-",A1)+1,99),CHAR(160)," "),",",REPT(" ",99)),99))
 
Upvote 0
Using the following code solved my spacing issue. Thank you!

=TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(MID(A1,FIND(",",A1)+1,99)&" "&MID(A1,FIND("-",A1)+1,99),CHAR(160)," "),",",REPT(" ",99)),99))
 
Upvote 0
You're welcome, welcome to the forum, thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,305
Members
449,079
Latest member
juggernaut24

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top