Ignore and/or replace some text in cell

drluke

Active Member
Joined
Apr 17, 2014
Messages
314
Office Version
  1. 365
Platform
  1. Windows
In A1 I have: James Mansfield - Team 100

In B1 I want: Mansfield J I need it this way to be able to do a lookup from another worksheet.

My problem is that I don't know how to get rid of the - Team 100. So far I have

=REPLACE(A1,1(FIND(" ",A1),"")&" "&LEFT(A1,1)

The result I get from this is: Mansfield - Team 100 J
 

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)
This?


Excel 2010
AB
1James Mansfield - Team 100Mansfield J
Sheet17
Cell Formulas
RangeFormula
B1=TRIM(MID(SUBSTITUTE(A1," ",REPT(" ",100)),100,100))&" "&LEFT(A1,1)
 
Upvote 0
Whilst there will be better ways of doing this.
How about
=MID(A1,FIND(" ",A1)+1,FIND(" - ",A1)-FIND(" ",A1)) & " " & LEFT(A1,1)
 
Upvote 0

Forum statistics

Threads
1,214,948
Messages
6,122,420
Members
449,083
Latest member
Ava19

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