Remove second part of hyphenated word

kbianco

New Member
Joined
Aug 9, 2023
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi there,

Trying to convert text within one cell to a simplified version. For example, I have a cell that reads "UK Fund Mid-Cap Blend" but I want to convert this to "Mid Blend". Right now, I am using the below formula to strip "UK Fund Mid-Cap Blend" down to "Mid-Cap Blend". cell C9 represents the full text string.

=MID(C9,FIND("@",SUBSTITUTE(C9," ","@",LEN(C9)-LEN(SUBSTITUTE(C9," ",""))-1))+1,100)

I want to take this one step further and remove the "-Cap" portion of Mid-Cap, so that the cell just reads "Mid Blend". Also, i want to be able to use this across a variety of inputs. I.e Will need to convert Mid-Cap Growth to Mid Growth.

Any ideas?

Thanks!
Kayla
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Perhaps try this since you have Excel 365?
Excel Formula:
=TEXTJOIN(" ",1,TAKE(TEXTBEFORE(TEXTSPLIT(C9," "),"-",,,1),,-2))
 
Upvote 0
Solution
wow - that worked perfectly! thank you so much. appreciate the help
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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