Cana forumla extract what I need

easybpw

Active Member
Joined
Sep 30, 2003
Messages
437
Office Version
  1. 365
  2. 2013
Platform
  1. Windows
Hello and thanks in advance for the help. Below is a string of characters and I need to extract the last name of the employee. The format will always be the same, there will always be 3 numbers to the left with a space between. I can extract everything to the left but my limited knowledge doesn't allow me to do what I need. In my example below I am looking for "Smith".

Tender type: Staff Charge Employee ID: 99999999 Cost centre: 005 Smith,John

Thanks again!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Try:

=TRIM(RIGHT(SUBSTITUTE(REPLACE(A1,FIND(",",A1),LEN(A1),"")," ",REPT(" ",LEN(A1))),LEN(A1)))
 
Upvote 0
Hello and thanks in advance for the help. Below is a string of characters and I need to extract the last name of the employee. The format will always be the same, there will always be 3 numbers to the left with a space between. I can extract everything to the left but my limited knowledge doesn't allow me to do what I need. In my example below I am looking for "Smith".

Tender type: Staff Charge Employee ID: 99999999 Cost centre: 005 Smith,John

Thanks again!


Is there always going to be a comma directly after the last name?

Will there ever be a comma in any other part of the string, other than directly after the last name?

-Spydey


P.S. Looks like Eric W. beat me to it .... hehehe.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,358
Messages
6,124,487
Members
449,165
Latest member
ChipDude83

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