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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
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,215,454
Messages
6,124,931
Members
449,195
Latest member
Stevenciu

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