How to extract text before or after a second hyphen(-) using formula

sayseee

New Member
Joined
Nov 25, 2021
Messages
22
Office Version
  1. 2019
Platform
  1. Windows
I have my data in column A and I want to separate the strings as seen in column HOME and AWAY.

DATAHOMEAWAY
Al-Faisaly - Al TaeeAl-FaisalyAl Taee
Al-Nassr - Al-ShababAl-Nassr Al-Shabab
Al-Shabab - Al-Ittihad FCAl-ShababAl-Ittihad FC
Al-Hazem - Al-ShababAl-HazemAl-Shabab
Al-Shabab - Al-FatehAl-ShababAl-Fateh


using normal LEFT formula
Excel Formula:
LEFT(A2,FIND("-",A2)-1)
in column B, I get as below and this is not what i need.
WettPoint.xlsm
ABC
1DATAHOMEAWAY
2Al-Faisaly - Al TaeeAlAl Taee
3Al-Nassr - Al-ShababAlAl-Shabab
4Al-Shabab - Al-Ittihad FCAlAl-Ittihad FC
5Al-Hazem - Al-ShababAlAl-Shabab
6Al-Shabab - Al-FatehAlAl-Fateh
Sheet3
Cell Formulas
RangeFormula
B2:B6B2=LEFT(A2,FIND("-",A2)-1)


How do I get through this?
Thank you
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi

Excel Formula:
=FILTERXML("<y><z>"&SUBSTITUTE(A2," - ","</z><z>")&"</z></y>","//z[position()=1]")
=FILTERXML("<y><z>"&SUBSTITUTE(A2," - ","</z><z>")&"</z></y>","//z[position()=2]")
 
Upvote 0
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,252
Members
452,623
Latest member
Techenthusiast

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